The Heat pump principle.
The refrigerant in the heat pump evaporates (Boyles Law) at low temeratures, the source energy whether air or water routes through the evaporator (heat exchanger) where the refrigerant circulates. The regrigerant extracts the energy and the refrigerant changes from a liquid into a gas, a scroll compressor draws the regrigerant in and compresses it.
The increase in pressure raises the temperature. The compressor is is of a suction gas cooled designed so the energy/heat of the electric motor is not lost but reaches the downstream condenser together with the compressed regrigerant.
The refrigerant releases it’s absorbed energy to the circulating system via the condenser to the circulating system to the hot water and heating circuit, The expansion valve deduces the pressure of the refrigerant for the process to start all over again. To learn more and see a diagram please click on this link subheat.co.uk andit will take you to the web page.