Corrosion is a redox reaction in which a pure metal reacts with substances in the environment, returning to an ore-like state. Aluminum, for example, rapidly oxidizes in air:

4 Al(s) + 3 O2(g) → 2 Al2O3(s).

This the surface of the Al(s) in a thin layer of Al2O3(s), preventing any further corrosion on the inside—oxygen cannot get past the aluminum oxide to corrode the pure aluminum.

When iron corrodes, the rust flakes off and exposes new iron. This requires the presence of both oxygen and water. It is accelerated by acidic solutions, electrolytes, mechanical stress, and contact with less active metals. There are multiple steps in the rusting process:

  1. Fe(s) → Fe2+(aq) + 2 e
  2. ½ O2(g) + H2O(l) + 2 e → 2 OH(aq)
  3. Fe(OH)2(s) is further oxidized and becomes yellow-brown Fe(OH)3(s).
  4. Some Fe(OH)3(s) becomes Fe2O3 · 3 H2O(l).
  5. The final red-brown rust is referred to as Fe2O3 · `x` H2O(l).

The iron oxidation occurs at one location (anode) and the oxygen reduction occurs at another (cathode). The rust piles up between them. Eliminating either water or oxygen makes this rusting process impossible.

There are two methods for preventing corrosion. Protective coating is just what it sounds like: cover up the surface to prevent it from coming in contact with oxidizing agents. Cathodic protection works by supplying the iron with an electric current, forcing the metal to become the cathode and making corrosion non-spontaneous. You can combine both methods using a sacrificial anode, where you coat the surface with a more active metal. This protects the surface and it forces the other metal to be the cathode. Zinc plating, also known as galvanizing, is an example of this.