Heat pumps are actually exactly what the title says.
Using compressors they are able to extract heat even from relatively cold air and transfer the energy inside.
They can use 100 watts of electric energy to move 400 watts of heat from outside to inside.
The downside is that the colder it is outside the less efficient they get (since there is less heat outside) so it only works in relatively temperate climates.
What I don't get is the comparison to gas though. Like how can burning natural gas to generate electricity then using that electricity on a separate device be more efficent than just burning the natural gas directly for heat. The essential output of natural gas is heat to generate electricity if the heat pump were 4x efficient then could a natural gas plant generate electricity, run a giant heat pump and then use the heat to generate 4x more electricity?
This does only apply for air-sourced heat pumps though. Unless you are literally living on an ice-sheet, a ground-sourced heat pump can be efficient all-year round and beat out an air system easily.
They can use 100 watts of electric energy to move 400 watts of heat from outside to inside.
The downside is that the colder it is outside the less efficient they get (since there is less heat outside) so it only works in relatively temperate climates.