How does a fuel cell work?

In fuel cells, hydrogen and oxygen react in a controlled manner to efficiently generate electrical power and heat.

The animation below shows the fuel (e.g. natural gas) entering the reformer, where it is transformed into hydrogen (orange spheres). At the anode catalyst, hydrogen splits into a positive part, the proton (H+) and a negative part, the electron (e-). The membrane of a fuel cell is permeable for protons, but not for electrons.  Thus, the electrons flow through the external circuit  - including an power consumer such as a motor - and return to the cathode side of the fuel cell. On the cathode, oxygen gas (blue spheres) takes up electrodes and protons forming water – the primary exhaust emission of a fuel cell.
In order get the power of the fuel cell up to a reasonable level, many separate membrane electrode assemblies must be combined to form a fuel-cell stack.