The refining of gas uses a lot of energy and must be considered when gauging the energy one gets from burning it. This article is from a lefty source, but it is interesting.
https://www.cfr.org/blog/do-gasoline-based-cars-really-use-more-electricity-electric-vehicles-do#:~:text=The%20math%20behind%20the%20claim%20is,is%20based%20on%20outdated%20efficiency%20figures.%29&text=The%20math%20behind%20the,on%20outdated%20efficiency%20figures.%29&text=behind%20the%20claim%20is,is%20based%20on%20outdated
It takes about 4% of a barrel to refine a barrel of oil. It can’t be helped and it’s built into the price of gas.
If anybody can figure out how to refine oil more cheaply, they will be billionaires a few times over.
https://www.osti.gov/biblio/7261027