The ability to function as both a heating and cooling system is the biggest attraction of heat pump systems, especially in mid- to lower latitudes.
Most heat pumps used in North America are more-specifically classified as air-to-air heat pumps. They absorb heat from outside air and release that heat into a forced-air distribution system within the building. The heat is moved using a standard vapor-compression refrigeration cycle. Cold liquid refrigerant is evaporated within the outside heat exchanger. The heat-laden refrigerant gas is then piped to the compressor that greatly increases both its pressure and temperature. The hot gas is routed inside to a refrigerant-to-air heat exchanger where it condenses back to a liquid giving up the heat it transported to the building's forced-air distribution system. The final step is to pass the cooled liquid through a thermal expansion valve that lowers its pressure and temperature, readying it for another trip to the outdoor unit.