How does hydrogen electrolysis work?
Electricity splits water into hydrogen and oxygen. Then the hard part starts.
An electrolyser passes direct current through water between two electrodes. Hydrogen collects at one, oxygen at the other. The principle is taught in school science classes and scales to industrial plants.
Making hydrogen is not the challenge. Compressing it, storing it in certified pressure vessels, preventing leaks through fittings that would hold any other gas, and moving it safely — those are the challenges.
Round-trip efficiency is also poor. Electricity to hydrogen and back to motion loses far more energy than putting the same electricity into a battery. Hydrogen earns its place in long-duration storage and heavy industry, not in outcompeting a home charger.
Educational overview only. Before acting on any of this, review the safety fundamentals and local regulations.