Corrosion is defined as a process where materials, usually metals, deteriorate as a result of a chemical reaction with air, moisture, chemicals, etc.
For example, iron, in the presence of moisture, reacts with oxygen to form hydrated iron oxide.
4Fe + 3O2 + nH2O → 2Fe2O3.nH2O
Rancidity is the process of oxidation of fats and oils that can be easily noticed by the change in taste and smell is known as rancidity.
For example, the taste and smell of butter changes when kept for long.