The potato itself has a mixture of starches and salts and some water. A salt, like table salt, in water releases ions. Ions are atoms that have an electrical charge.
Salt releases two ions, a sodium ion that has a + charge, and a chlorine ion that has a – charge. When two dissimilar metals, such as zinc and tin, or steel and copper, are placed into the potato they will take on these charges. One will be predisposed to be more + or – negative than the other, allowing for the flow of electrons to occur.