Heat pumps do not generate heat but extract it from one body of air and transfer it to another. They use the same principle as your fridge, compressing gas and then allowing it to expand, extracting heat as it does so. Even if the air outside is freezing, heat pumps can extract heat energy and transfer it inside to keep you warm. In summer the system works in reverse, extracting heat from indoors and transferring it outside leaving you comfortable and cool.