
A hydrogen fuel cell makes electricity from a chemical reaction. In a common design, a catalyst at one side separates hydrogen into protons and electrons. The protons can cross a thin membrane. The electrons go around through an outside circuit, where they can do work before they reach the other side.
What happens when they get there?
Oxygen from the air combines with the protons and electrons and makes water. The process also makes heat. Keep supplying hydrogen and air and the cell can keep making current.
How is that different from a battery?
Both use chemistry to produce electricity. A battery carries the materials for its reaction inside it. A fuel cell gets a steady supply of fuel from outside. Either way, the electricity coming from the cell is DC, so it needs an inverter if it’s going to supply an AC circuit.
For more on different ways to make electricity, see Basics of Electric Utilities 101.