The first fuel cell was built in 1839 by Sir William Grove. Up till the 1960's the NASA developed the fuel cells for the Gemini and Apollo spacecraft. The other technologies to produce energy where too expensive (solar cells) or too dangerous (nuclear power).
The hydrogen and the oxygen burn "cold" (40°C - 90°C) in a fuel cell to form water. The fuel cell consists of a membrane which is only permeable for the protons of the hydrogen. The electrons of the hydrogen have to pass the electric circuit to react with the oxygen.
If you click in the right picture you will get more details about the membrane.
The efficiency of a fuel cell is more than 65%.
A fuel cell operates for more than 200000 hours with constant current output.
A variety of fuels can be used, for example: hydrogen, methanol, ethanol, natural gas, and liquefied petroleum gas.