A galvanic cell (left) transforms the energy released by a spontaneous redox reaction into electrical energy that can be used to perform work. The oxidative and reductive half-reactions usually occur in separate compartments that are connected by an external electrical circuit.
Oxidation half reaction:
Y ----> Y+ +e-
Reduction half reaction:
Z + e- ----> Z-
overall cell reaction
Y+Z ------> Y+ + Z- (G<0)
A second connection that allows ions to flow between the compartments (shown here as a vertical dashed line to represent a porous barrier) is necessary to maintain electrical neutrality. The potential difference between the electrodes (voltage) causes electrons to flow from the reductant to the oxidant through the external circuit, generating an electric current.