That’s because electric motors can be as high as 98-99% efficient at converting electric power into work while small internal combustion engines peak out at about 35% and that’s generous. 20% is more typical. Then for ICE you have additional losses in the transmission that don’t happen for electric.
The vast majority of the energy in liquid fuel heats the air around the car.
This is also why a normal sized EV powered entirely by coal fired electricity can emit less carbon per mile than an efficient ICE car or even a hybrid. A big supercritical steam turbine in a coal power plant is going to be well over twice as efficient at converting heat into useful work than a small ICE. (Few people get all their power from coal, which is the worst case for CO2 emission, so in practice EVs are pretty much always lower carbon.)
Small heat engines suck.