Hydrogen, or a hydrogen-rich fuel, is fed to the anode where a catalyst separates hydrogen's negatively charged electrons from positively charged ions (protons).
At the cathode, oxygen combines with electrons and, in some cases, with species such as protons or water, resulting in water or hydroxide ions, respectively.
For polymer electrolyte membrane and phosphoric acid fuel cells, protons move through the electrolyte to the cathode to combine with oxygen and electrons, producing water and heat.
For alkaline, molten carbonate, and solid oxide fuel cells, negative ions travel through the electrolyte to the anode where they combine with hydrogen to generate water and electrons.
The electrons from the anode side of the cell cannot pass through the electrolyte to the positively charged cathode; they must travel around it via an electrical circuit to reach the other side of the cell. This movement of electrons is an electrical current. Dept. of Energy