Heat pump water heaters work by retrieving surrounding heat using refrigerant and transferring it to the water. Air from the surrounding is drawn into the system and refrigerant absorbs heat from it.
The refrigerant is pumped and becomes hot. Coldwater moves to the upper region of the appliance where hot refrigerant delivers its heat to the water. The water after getting heated gets stored In the tank for further usage.