How do electrochemical cells produce voltage?
Electrochemical cells produce a voltage by making the electrons from a spontaneous reduction-oxidation reaction flow through an external circuit.
Consider the spontaneous reaction of Zn metal in a solution of Cu²⁺:
Zn(s) → Zn(aq) + 2e⁻
Cu²⁺(aq) + 2e⁻ → Cu(s)
Zn(s) + Cu²⁺(aq) → Zn(aq) + Cu(s)
If we just dump the reactants (Zn and Cu²⁺) together, the Zn atoms will transfer their electrons directly to the Cu²⁺ ions. The Zn²⁺ ions will go into solution, and the Cu atoms will deposit on the surface of the Zn. We will get no useful energy from this process.
We can capture this energy by setting up an electrochemical cell to separate the two half reactions.
In this set-up, Zn has to pass its electrons to the Cu²⁺ through the external wire. The tendency of the system to go to a lower energy state shows up as a voltage (potential energy) difference between the electrodes.