Fuel cells utilize a combination of hydrogen and oxygen to produce electrical energy. This chemical reaction provides external energy, similar to a battery. However, while batteries are limited by their charging capacity, energy in fuel cells is continually supplied through hydrogen and oxygen gases.
This means electrical energy can be produced at a higher efficiency than simply burning hydrogen to produce heat to drive a generator, because it is not subject to the thermal bottleneck from the second law of thermodynamics.
Since the only by-product of this chemical reaction is water, fuel cells are pollution-free, making them a smart solution as a cleaner, more efficient source of energy.