To raise the temperature of my 300 square feet room by one degree I need the same amount of energy, no matter the source. But the ways of delivering that energy aren't the same.
If I have a simple gas burner, I need to know how much gas do I have to burn to heat my room. It will keep me warm, but it's not a good idea. Burning gas with a flame makes other gases that I don't want inside. I need to vent them, but I will lose some heat through that.
I can also get a gas furnace that condenses those byproduct gasses in a second heat exchanger for extra efficiency. Maybe seal it up better too. It needs a little electric power for ignition, so I need to take that into account. But overall, it would be more efficient. I would need less gas to heat my room.
Even though I'm using gas in both examples, the efficiency is different. It depends on how I convert that gas into heat.
I can also burn that gas in a generator to produce electric power. Then I can use that electric power for a resistive heater. Not a great idea, but it's an option.
I don't have to burn the gas myself. I can delegate generating power to a gas-fired power plant and buy power from them. And I can use a heat pump instead of a resistive heater. My heat pump will use less power than a resistive heater, so that's good, I suppose.
The question remains: how much gas do I (or a power plant) have to burn to heat my room. The answer depends on what do I use the gas for and how. That's the efficiency.
By burning oil or converting electricity to heat, 1 joule of stored chemical or electrical energy converted to heat energy will raise the heat of that something by a maximum of 1 joule. A maximum of 100% efficiency.
By using 1 joule of energy to compress cold gas into warm gas, we can raise the heat of that something by 3-4 joules. Moving heat energy around is more efficient that generating heat energy. Commercially available technology 300%-400% efficient.
This isn't correct. Here's a thought experiment to clarify:
If we burn X MJ of oil, we transfer X MJ of energy as heat to our house.
Otoh, if we set up a generator (say 40% efficient) which produces electricity from oil and dumps waste heat into our house, and use that to power a 300% efficient heat pump, we get 0.6X (generator waste heat) + 1.2X (300% * 0.4X) = 1.8X MJ of heat using the same X MJ of oil.
Thus,we get an additional 0.8X MJ of heat (80% extra heating) from the same X MJ of oil just by using a heat pump (& generator) compared to burning it. I.e we're using the energy stored inside the oil more efficiently.