The secret to the way fuel cells work lies in chemistry. Certain atoms tend to bond with other atoms to form molecules. Hydrogen and oxygen are a good example -- a pair of hydrogen atoms can bond with an oxygen atom to form H2O, a water molecule. By putting a couple of steps between hydrogen and oxygen bonding together, we can harness electrons.
The typical method involves two chambers. In one chamber, you have pressurized hydrogen gas (H2). In the other, you have oxygen (O2). Between these two chambers, you have a catalyst and a membrane. The catalyst causes hydrogen gas to split into electrons and positive hydrogen ions. The membrane is like a bouncer at a club: Cute positively charged ions can get through, but nerdy negative particles such as electrons can't.
Because of that bouncer, the positively charged hydrogen ions pass through the membrane to get at the oxygen atoms on the other side. Then, the hydrogen and oxygen bond together. But these molecules miss those electrons that got left behind. And here's how a fuel cell can provide electricity.
The secret is to create a pathway from the hydrogen chamber of the fuel cell to the oxygen chamber. This pathway connect to a circuit. The electrons will follow the pathway in order to reconnect to the hydrogen ions on the other side of the membrane. On their way, the electrons will do work -- flowing through whatever circuitry happens to be along the path. On the far side of the path is the oxygen chamber, where the electrons will rejoin the hydrogen ions. The two byproducts of this particular reaction are heat and water.
There are several different types of fuel cells. While in the example above we used pure hydrogen and oxygen, most fuel cells rely on other types of fuel. That's because getting pure hydrogen is difficult and raises the cost of producing and operating fuel cells. Other types of fuel can create the hydrogen needed for a fuel cell but also produce other byproducts.
Some of these fuel cells can only operate at temperatures much higher than would be practical for a fuel cell that can fit into your pocket. Others rely on catalysts made from rare materials like platinum, which increases the cost of a fuel cell. A few can't operate below a certain temperature threshold because the membrane will freeze. Finding the right fuel cell for mobile electronics is important.
So what kind of fuel cell might we be able to use to recharge our phones?