Pitting is most commonly induced very aggressive agents e.g. halides like chloride ions which can destroy protective or passive surface films of aluminium, stainless steels, nickel alloys, etc. The degradation can be initiated by a tiny surface defect; a scratch, local change in composition, or damage to a protective coating. ("Pitting" 4). It occurs when these alloys are exposed to chloride [or halide] containing solutions. (DME: 7) The reaction begins when a passive film or protective surface layer is broken down. After this initiation (local breakdown of the film) an anode forms where the film has broken, while the unbroken film (or protective layer) acts as a cathode, thus accelerating localised attack and pits formation at the anodic spots (DME: 6). Further corrosion will continue due to the high acidification (due to high chloride concentration) of the electrolyte inside the growing crevice (DME: 7).
Pitting can be prevented or slowed down by using "corrosion inhibitors such as hexamine, sodium nitrite and condensation products of aldehydes among others" ("Pitting" 7).