Salt and a Battery
Putting energy to work requires solution of a pair of problems: finding a source and storing the energy until we are ready to use it. Biological systems have developed elaborately multi-layered solutions. Mostly our source is the Sun. The invention of photosynthesis was the big breakthrough, taking energy from the Sun and storing it in carbohydrates (which, for future reference, pack about 17 MJ of energy per kilogram of weight). Other systems facilitate short term storage (ATP) and long term (fat).
Some of that energy of photosynthesis was tucked away in the decaying organic matter that became the fossil fuels that tens of millions of years later are our primary source of energy. Those fossil fuels, in various refined forms, are admirably suited to be both sources of energy for us and compact, highly portable, high-energy storage media ready for use in our combustion engines.
We have gotten better at extracting energy more directly from the Sun, especially in the form of electricity. Improvements in electric power distribution systems can alleviate the storage problem but not solve it. Solar energy is available only part of the time, even in the sunniest climes, and hooking cars and trucks to the grid is a problem. The time-honored solution for storing electric energy is the rechargeable battery, especially the metal-ion salt based battery.
Batteries bring a few problems, but the worst one is the low ratio of stored energy to weight. A lead-acid battery can store about 0.14 MJ/kg, compared to some 46.4 MJ/kg for gasoline , or 331 times the energy density. Lithium-ion batteries are can pack 3-5 times as much energy per weight as their lead footed brethren, but that still leaves them hopelessly behind in the energy density race.
These numbers would appear to indicate that it’s hopeless to expect batteries to compete with gasoline, but it’s not quite that bad. Electric motors can be far simpler than the internal combustion engine, and can dispense with a lot of the life support and Power transmission infrastructure that the internal combustion engine requires.
Part of the advantage to gasoline (and similar fuels) is that the heaviest component of their chemical reaction, oxygen, is supplied free of charge by the atmosphere. In principle, fuel cells can use the same trick, and so can an open-cell system like the still under development lithium-air battery, which in principle can achieve 40 MJ/kg, though a tenth of that in practice would still be great.
Of course if you want truly great mileage for your fuel weight, you might need to indulge in more exotic technologies, deuterium-tritium fusion, for example, at 576,000,000 MJ/kg (576 TJ/kg), or matter anti-matter annihilation (90 PJ/kg = 9x10^10 MJ/kg). A bit of exotic vacuum from the pre-inflation universe would be even more potent. Some further engineering development might be required in each case.