The heat pump inside an air conditioner is the method by which the unit removes heat from indoor air. The system consists of a set of evaporator coils indoors to absorb heat, a set of condenser coils outdoors to release heat, and a coolant to carry heat between the two.
When the coolant passes through the evaporator coils, it absorbs heat from the indoor air, converting into a low-density, warm gas. It passes through a compressor, increasing both the pressure and the heat of the gas. When it reaches the condenser coils outside, excess heat is released into the atmosphere, condensing the coolant back into a liquid state. It then flows back indoors, ready to absorb more heat energy. As more energy is absorbed from the air passing over the evaporator coils, the ambient temperature of the air drops.
A heat pump heating and cooling system uses this technique to cool a home, but can also be switched into reverse to provide heat in winter. The outdoor coils absorb heat from the air or from the ground and carry that heat inside to be released into the home. Heat pumps are energy efficient since they use ambient warmth instead of burning fuel or using electricity to generate heat, but they have difficulty when outside temperatures dip below freezing.