When a gas is compressed, it heats up. When it is uncompressed, it cools. Imagine the simplest possible compressor – a bicycle pump. Hold your finger over the exit and push the pump handle. The air inside will get very hot. Lift your finger and let the hot air out, and it cools again. Imagine that the cylinder of the bicycle pump was inside your house but the exhaust air was vented through a window. When you pumped the bicycle pump, the chamber would get hot, and this heat would heat the room. As the air left the pump and was exhausted to the outside air, it would cool, tending to reduce (to a very tiny extent of course) the external temperatures.
This is the principle of a heat pump. The heat from the compressed gas is used to increase temperatures in one place; whereas the reverse – heat loss from the decompression – decreases temperatures in another place. Think of this as taking a block of air and separating it into a hot gas and cold gas in two separate places. When temperatures are high, you can reverse the pump, putting the cold air into the house and the hot air outside. Most heat pumps transfer the heat or cold into water that is then circulated round the house. So a domestic heat pump can, under certain circumstances, use a house’s existing network of hot water pipes and radiators. Similarly, a heat pump can provide the hot water for domestic baths and showers.