All batteries depend on some chemical reaction of the form reactants → products
for the generation of electricity or on the reverse reaction as the battery is recharged. The change in free energy (−ΔG) for a reaction could be determined by measuring directly the amount of electrical work that the battery could do and then using the equation Wmax = −ΔG. However, the power of thermodynamics is that −ΔG can be calculated without having to build every possible battery and measure its performance. If the Gibbs free energies of the individual substances making up a battery are known, then the total free energies of the reactants can be subtracted from the total free energies of the products in order to find the change in Gibbs free energy for the reaction,
ΔG = Gproducts − Greactants. (16)
Once the free energies are known for a wide variety of substances, the best candidates for actual batteries can be quickly discerned. In fact, a good part of the practice of thermodynamics is concerned with determining the free energies and other thermodynamic properties of individual substances in order that ΔG for reactions can be calculated under different conditions of temperature and pressure.
In the above discussion, the term reaction can be interpreted in the broadest possible sense as any transformation of matter from one form to another. In addition to chemical reactions, a reaction could be something as simple as ice (reactants) turning to liquid water (products), the nuclear reactions taking place in the interior of stars, or elementary particle reactions in the early universe. No matter what the process, the direction of spontaneous change (at constant temperature and pressure) is always in the direction of decreasing free energy.