Rusting of iron consists of the formation of hydrated oxide, Fe(OH)3, FeO(OH), or even Fe2O3.H2O. It is an electrochemical process which requires the presence of water, oxygen and an electrolyte. In the absence of any one of these rusting does not occur to any significant extent. In air, a relative humidity of over 50% provides the necessary amount of water and at 80% or above corrosion of bare steel is worse.
When a droplet of water containing a little dissolved oxygen falls on an steel pipe, the solid iron or Fe(s) under the droplet oxidizes:
Fe(s) --> Fe2+(aq) + 2e-
The electrons are quickly consumed by hydrogen ions from water (H2O) and dissolved oxygen or O2(aq) at the edge of the droplet to produce water:
4e- + 4H+(aq) + O2(aq) --> 2H2O(l)
More acidic water increases corrosion. If the pH is very low the hydrogen ions will consume the electrons anyway, making hydrogen gas instead of water:
2H+(aq) + 2e- --> H2(g)
But where's the rust? The equations above tell only a small part of the story.
Hydrogen ions are being consumed by the process. As the iron corrodes, the pH in the droplet rises. Hydroxide ions (OH-) appear in water as the hydrogen ion concentration falls. They react with the iron(II) ions to produce insoluble iron(II) hydroxides or green rust:
Fe2+(aq) + 2OH-(aq) --> Fe(OH)2(s)
The iron(II) ions also react with hydrogen ions and oxygen to produce iron(III) ions:
4Fe2+(aq) + 4H+(aq) + O2(aq) -->4Fe3+(aq) + 2H2O(l)
The iron(III) ions react with hydroxide ions to produce hydrated iron(III) oxides (also known as iron(III) hydroxides):
Fe3+(aq) + 3OH-(aq) --> Fe(OH)3(s)