First, consider the exposure of iron to aerated water at room temperature (aerated water will contain dissolved oxygen). The corrosion rate for iron as a function of pH is illustrated in the following figure. (reference)
Corrosion of steel as a function of water pH
In the range of pH 4 to pH 10, the corrosion rate of iron is relatively independent of the pH of the environment. In this pH range, the corrosion rate is governed largely by the rate at which oxygen reacts with absorbed atomic hydrogen, thereby depolarizing the surface and allowing the reduction reaction to continue. For pH values below 4.0, ferrous oxide (FeO) is soluble. Thus, the oxide dissolves as it is formed rather than depositing on the metal surface to form a film. In the absence of the protective oxide film, the metal surface is in direct contact with the acid solution, and the corrosion reaction proceeds at a greater rate than it does at higher pH values.
It is also observed that hydrogen is produced in acid solutions below a pH of 4, indicating that the corrosion rate no longer depends entirely on depolarization by oxygen, but on a combination of the two factors (hydrogen evolution and depolarization). For pH values above about pH 10, the corrosion rate is observed to fall as pH is increased. This is believed to be due to an increase in the rate of the reaction of oxygen with Fe(OH)2 (hydrated FeO) in the oxide layer to form the more protective Fe2O3 (note that this effect is not observed in deaerated water at high temperatures).