Answer: Corrosion is faster at low pH, in impure metals, when the anode is small and the cathode large, and when the corrosion product is porous or soluble; it is slow when the product forms a compact, protective film.
(i) pH of the medium. In acidic media (pH below about 4) the cathodic reaction \(2\text{H}^++2e^-\to\text{H}_2\) is easy, so metals like Fe corrode rapidly. Between pH about 4 and 10 the rate of iron corrosion depends mainly on how much dissolved oxygen reaches the surface. Above about pH 10 iron becomes passive and corrosion falls. Amphoteric metals (Al, Zn, Pb) corrode in both acidic and strongly alkaline media.
(ii) Purity of the metal. Impurities (e.g. Fe or Cu in Zn) form tiny galvanic cells with the base metal: the more active part acts as anode and corrodes. So the higher the impurity content, the faster the corrosion. Example: 99.999% pure Zn corrodes far more slowly in acid than commercial Zn.
(iii) Areas of anode and cathode. The rate of corrosion is proportional to \(\dfrac{\text{area of cathode}}{\text{area of anode}}\). The total electron current at the cathode must be supplied by the anode, so a small anode with a large cathode suffers intense, localised corrosion. Example: a steel rivet (small anode) in a copper plate (large cathode) corrodes quickly; a copper rivet in a steel plate is much safer.
(iv) Nature of the corrosion product. If the product forms a thin, continuous, non-porous and insoluble film (e.g. Al₂O₃ on Al, Cr₂O₃ on stainless steel), it isolates the metal from the environment and corrosion stops (protective film). If the product is porous, volatile or soluble (e.g. rust on iron, MoO₃ which is volatile), fresh metal stays exposed and corrosion continues. (Pilling–Bedworth rule: protective when the volume of oxide is equal to or greater than the volume of metal consumed.)