The voltaic pile was a set of individual electrochemical cells placed in a stack separated by an electrolyte, such as pasteboard soaked in brine. When both ends of the tower were connected with wire, it generated an electric current.
The pile produced a charge due to molecular reactions, involving each zinc disc being partially dissolved by the acidic brine disc, leading to zinc atoms losing two electrons each. The zinc atoms became ions, passing into the brine disc and coming into contact with a silver or copper disc on the other side, where their lost electrons were replaced.
This generated excess electrons within the zinc disc that would travel through the cell and replace the electrons stolen by the zinc atoms from the silver disc. This continuous flow of electrons created a steady current, which had eluded scientists for many years.