If u are refering to the corrosion of metal due to an acid, then i think it is because at the site where oxygen is present in a good amount, the metal combines with it and forms a layer of oxide over it. These oxides are stable to a good extent.
This prevents the action of acids on the metal (usually if the acid is not too concentrated).
I think this is the answer.....not too sure.