The concept of reversing the direction of the spontaneous reaction in a galvanic cell through the input of electricity is at the heart of the idea of electrolysis. See for a comparison of galvanic and electrolytic cells. If you would like to review your knowledge of galvanic cells (which I strongly suggest) before learning about electrolytic cells, click here.
Electrolytic cells, like galvanic cells, are composed of two half-cells--one is a reduction half-cell, the other is an oxidation half-cell. Though the direction of electron flow in electrolytic cells may be reversed from the direction of spontaneous electron flow in galvanic cells, the definition of both cathode and anode remain the same--reduction takes place at the cathode and oxidation occurs at the anode. When comparing a galvanic cell to its electrolytic counterpart, as is done in , occurs on the right-hand half-cell. Because the directions of both half-reactions have been reversed, the sign, but not the magnitude, of the cell potential has been reversed. Note that copper is spontaneously plated onto the copper cathode in the galvanic cell whereas it requires a voltage greater than 0.78 V from the battery to plate iron on its cathode in the electrolytic cell.
You should be asking yourself at this point how it is possible to make a non-spontaneous reaction proceed. The answer is that the electrolytic cell reaction is not the only one occurring in the system-the battery is a spontaneous redox reaction. By Hess's Law, we can sum the ΔG of the battery and the electrolytic cell to arrive at the ΔG for the overall process. As long as that ΔG for the overall reaction is negative, the system of the battery and the electrolytic cell will continue to function. The condition for ΔG being negative for the system (you should prove this for yourself) is that Ebattery is greater than - Ecell.
During the early history of the earth, hydrogen and oxygen gasses spontaneously reacted to form the water in the oceans, lakes, and rivers we have today. That spontaneous direction of reaction can be used to create water and electricity in a galvanic cell (as it does on the space shuttle). However, by using an electrolytic cell composed of water, two electrodes and an external source emf one can reverse the direction of the process and create hydrogen and oxygen from water and electricity. shows a setup for the electrolysis of water.
The reaction at the anode is the oxidation of water to O2 and acid while the cathode reduces water into H2 and hydroxide ion. That reaction has a potential of -2.06 V at standard conditions. However, this process is usually performed with [H+] = 10-7 M and [OH-] = 10- 7 M, the concentrations of hydronium and hydroxide in pure water. Applying the Nernst Equation to calculate the potentials of each half-reaction, we find that the potential for the electrolysis of pure water is -1.23 V. To make the electrolysis of water occur, one must apply an external potential (usually from a battery of some sort) of greater than or equal to 1.23 V. In practice, however, it is necessary to use a slightly larger voltage to get the electrolysis to occur on a reasonable time scale.
Pure water is impractical to use in this process because it is an electrical insulator. That problem is circumvented by the addition of a minor amount of soluble salts that turn the water into a good conductor (as noted in ). Such salts have subtle effects on the electrolytic potential of water due to their ability to change the pH of water. Such effects from the salts are generally so small that they are usually ignored.