In terms of chemical thermodynamics, a chemical reaction proceeds spontaneously if the result of the reaction is to decrease the free energy of the system. The amount of free energy available to the system corresponds to the maximum amount of useful work that can be performed before the system reaches the equilibrium state. The construction of a galvanic cell makes it possible to harness the free energy change of a chemical reaction in the form of electrical work. Like a counterweight that has been raised against gravity, the electrons of a galvanic cell are poised to flow from the anode to the cathode. As current flows, the electrons move from the generally higher potential energy environment of the reducing agent to the lower potential energy environment of the oxidizing agent like water through a dam ('generally' because we have made a conceptual substitution of internal energy change for free energy change here; if the reaction is past the equilibrium point, for example, it might run in 'reverse').

The work done by an electric current equals the product of the amount of charge that flows (coulombs) and the amount of energy available per coulomb (joules per coulomb or volts). The energy available for work per coulomb of charge is the cell potential, Ecell. So free energy change of a chemical reaction can be used to determine the cell potential and vice versa.

Just as a reaction approaching equilibrium decreases in free energy, a galvanic cell approaching equilibrium (a battery going dead) loses its voltage.

δG = δG0 + 2.303 RT log Q

E = E0 - [(2.303 RT)/(nF)] log Q