The chemical or electrochemical reaction between a material, usually a metal, and its environment that produces a deterioration of the material and its properties.