If you have large amounts of solar or nuke power you can capture CO2 from the air or seawater add in the hydrogen from electrolysis run the reverse water gas shift to turn H2 + CO2 into CO based syngas and make liquid fuels depending on the catalysts you can make any of the simple alcohols like methanol, ethanol, propanol, butanol. Propanol and Butanol are close enough to petrol in Mj/Kg that no adjustments are needed for modern OBDII controlled engines the fuel maps are wide enough to accommodate the fuel air mix needed for either. Using cobalt catalysts the higher alkanes are in reach all the way up to C25+ Pennzoil uses this process to make synthetic motor oils, Iron catalysts yield the light alkane series with methane, ethane, propane, butane ,hexane being the dominate products. The South Africans use stores synthesis to make liquid fuels by the millions of gallons per year they source the syngas from coal but the process doesn’t care where the CO and H2 comes from as long as the CO to H2 ratio is at least one to three. The US Navy has tested and produced jet fuel from seawater using just electricity as the energy source as seawater has 180 times the CO2 content relative to air extracting CO2 from it during the electrolysis process is a free byproduct. The US Navy plans to make jet fuel on board the carriers with excess nuke power rather than shipping jet fuel around the world in tanker ships. They already flew a drone on the synthetic jet fuel from the process a F18 is next.
Hydrogen is an energy storage mechanism. When you charge a battery, you get less energy out of the battery than what you put in because of heat loss. But a hydrogen tank can be filled in 5 minutes versus the hours it takes to recharge a battery.