It even works when the outside temperature is below freezing!
A heat pump converts large amounts of so-called "low grade energy" in the environment (even very low temperatures) to a smaller amount of high grade energy at a more usable temperature (e.g. 35°C). Heat pumps can keep working effectively down to outside temperatures of -20°C. The environment benefits as well, since no emissions are created locally unlike a wood burning stove or conventional boiler for example.
Heat pumps work most economically when the difference between the heat source (ground or air) and the temperature of the heating circuit is as small as possible. Because of this low temperature heating systems, like under floor heating are the ideal partners for a heat pump.