A heat pump transfers heat from heat source to a heat sink at higher temperature. The heat source can be the outdoors air and the heat sink can be the air of the room. Hence a heat pump moves the heat on the opposite sense of the spontaneous heat flow:
In order to be able to invert the heat flow, it is necessary to use a thermodynamic cycle which is operated by a compressor. The compressor requires a work input, which usually is electricity. Thus the efficiency of the heat pump is defined as the energy delivered by the heat pump, divided by the work input of the compressor. This efficiency is called COP (Coefficient Of Performance). The maximum theoretical value of the COP depends on the temperature difference between the cold source and the hot sink: the bigger the difference, the lower is the theoretical and the real COP.
The image above represents a Sankey diagram of a heat pump with a COP = 5.