Rancidity can be of two types, hydrolytic and oxidative.
Hydrolytic rancidity is caused by a breakdown of the fat into glycerol and fatty acids. Oxidative rancidity results from oxidation of unsaturated and polyunsaturated fatty acids. The products of these reactions produce undesirable flavors and odors. These flavors sometimes develop in foods such as peanut butter, potato chips, and crackers. Manufacturers are permitted to add antioxidants to some foods to slow down this oxidative deterioration.