Fats and oils are esters. They react with alkalies such as NaOH,KOH to form Sodium/Potassium Salt of their carboxylic acids and glycerol. ester formed from acid +NaOH/KOH→soap+glycerol.Fatty acid such as palmitic acid, stearic acid react with alcohol, glycerol to form esters. Oils and fats are esters formed by the reaction between glycerol with fatty acid and stearic acid. Soaps are the salts formed when these react with alkalies.