Maybe I picked the wrong title. What is a heat pump may be a better starting point. The one word answer to why is “efficiency”. To understand that you need to understand what it is.
The name is the clue — it is a device that pumps heat from one place to another. A refrigerator is the most common example of a heat pump so let’s work with that to explain what is going on.
The graphic shows the pieces: two “radiators” and a pump. In the case of a refrigerator, the low-pressure radiator is on the inside and the high-pressure radiator is on the outside. A refrigerant is circulated through the system. Increasing the pressure causes the refrigerant to heat up and that heat above room temperature is dissipated into the room. Then, lowering the pressure makes the temperature of the refrigerant to drop. It is then circulated into the refrigerator where it cools the inside. Or, put another way, it pumps heat from inside to outside.
A refrigerator is but one example. An air conditioner works exactly the same. That goes for an air conditioner in a house or in a car. The efficiency will be a function of the temperature differences — that is, how hot it is outside vs. how cool you want your house or car to be inside.
Now, if we reverse the direction of the pump which side that gets hot and which side that gets cold is reversed. Thus, we have created space heating. We can warm the inside of our house or car. Again, the efficiency will be a function of the temperature differences. In the case of heating, we could never get over 100% efficient using resistance heating or a gas heater. But, we can do much better with a heat pump.