A heat pump is a mechanical compression cycle refrigeration system that is used to either heat or cool an area. Heat pumps work by transferring heat from one body, such as the ground, air or water, to another body. This can also be reversed to cool an area.
A heat pump can extract heat even from cold air because there is heat present in cold air as well as in hot air. Thus, in the summer a heat pump transfers the hot air from inside of a building to outside leaving the building cooler. In the winter, heat is extracted from the cold air outside and pumped into the building to make it warmer inside.