Wiki heat pump
A heat pump is a machine that moves heat from a cold place to a hot place.
Some buildings are heated with heat pumps, also. In the winter, the heat pump moves heat from the outside to the inside. Sometimes this works better than heating with a radiator.
Usually, heat flows from a hot place to a cold place, according to the second law of thermodynamics. Heat will not move from a cold place to a warmer place by itself. Because of this, a heat pump must use extra energy to move the heat. This is sort of like pumping water uphill.
Most heat pumps use electric motors to provide energy. Some heat pumps use heat energy, supplied by a flame or an electric heater.
Most heat pumps use a refrigeration cycle. A refrigeration cycle uses a fluid which moves through tubes and carries the heat. The fluid is called a refrigerant. During the refrigeration cycle, the refrigerant changes from a liquid to a gas and back to a liquid.
The heat pump is set up so that the refrigerant gains heat from one place that will be cooled, and moves it to another place that will be warmed.
A heat pump forces the refrigerant to change from a gas to a liquid. It uses a compressor to do this. Often, an electric motor drives the compressor. The compressor compresses the refrigerant, and this makes it change from a gas to a liquid. When the refrigerant changes from a gas to a liquid, it also gives up some of the heat that it has been carrying.
At the other end of the cycle, the refrigerant boils again. It changes from a liquid to a gas. But it needs heat to do this. When it takes up heat from its surroundings, it cools them down. So where the refrigerant is changing from a liquid to a gas, it feels cooler.