Iron corrosion is a short-circuited galvanic cell on one piece of metal. At an anodic site — often a scratch, grain boundary or impurity where the protective oxide is broken — iron gives up electrons: Fe → Fe²⁺ + 2e⁻. Those electrons travel through the metal itself (no wire needed, the bar is the conductor) to a nearby cathodic site, where dissolved oxygen in the moisture film consumes them: O₂ + 2H₂O + 4e⁻ → 4OH⁻.
The circuit only closes if ions can also move: Fe²⁺ migrates through the surface electrolyte film toward the cathode region while OH⁻ migrates the other way. Where they meet, they precipitate rust — hydrated iron(III) oxide, Fe₂O₃·xH₂O — usually a little away from the actual pit, which is why a scratch often rusts around its edges rather than exactly on it.
Anode: Fe → Fe²⁺ + 2e⁻
Cathode: O₂ + 2H₂O + 4e⁻ → 4OH⁻
Overall: 4Fe + 3O₂ + 2xH₂O → 2Fe₂O₃·xH₂O (rust)
Film thickness has two opposing effects, which is why this model peaks at moderate moisture rather than climbing forever: a thicker film conducts ions better (helps the cell), but it also slows the diffusion of atmospheric O₂ down to the cathode (the reaction here is usually cathode-limited by oxygen supply, not by how fast iron wants to give up electrons). Salt raises ionic conductivity directly, letting more current flow for the same driving force.