How does a Potato Battery Work?

When inserting two different metallic objects, for example a galvanized nail and a copper coin, into a potato, the two objects work as electrodes, causing an electrochemical reaction which generates a small potential difference. The potato simply provides a salt bridge for the reaction to occur.