How is it possible for a heat pump to consume 2kW electricity power and produce 8kW heat output to a house? Is the law of conservation of energy broken here? There is the scientific trick.
Assuming the outside equivalent temperature is 6°C and it takes 8kW heating power to keep the inside temperature of a house at 20°C with radiator in/out temp 45/40°C.

Referring to the diagram, inside a heat pump, a special fluid flows in a closed loop and maintains two temperatures -30°C and 60°C (approx) at two ends.
The ‘Evaporator’ end at -30°C is so cold, it’s able to draw heat energy from ambient air at a rate of Q1=6kW. The Electricity power of Q2=2kW is added to the fluid via the ‘Compressor’, driving it to 60°C at the ‘Condenser’ end where the heating power of Q3=8kW is transmitted to the radiators in the house.
In this case, energy conservation is maintained with:
Q3(8kW) = Q1(6kW) + Q2(2kW)