The gradual destruction or deterioration of metals or alloys due to chemical reactions with their environment.