An extensive explanation of this "primary energy fallacy":
https://ember-energy.org/latest-insights/reframing-energy-fo...
For example, you're counting all the energy in the gasoline that gets loaded into a car, not the useful work that the gasoline actually produces. Gasoline gars typically are only able to convert 20-30% of their fuel into propulsion.
Counting the energy in the fuel loaded into engines is like counting the amount of energy in the sunlight hitting a solar panel.
Similar things go for heating by the way. A modern heat pump often has a coefficient of performance of around 3x, meaning that for every joule of electricity you put into the pump, you can heat up a house with 3 joules of heat, so 3x as efficient as heating the house with combustion.