Soap is a sodium or potassium salt of fatty acid(stearic acid, oleic acid, plamitic acid). Sodium salt is present in washing soaps and potassium salt is present in bathing soaps. Acid gives glycerol and ester compounds which are present in animal fat(mutton tallow) and vegetable oil(fat).
Preparation of Soap: Vegetable oil (groundnut oil, caster oil etc.) or animal fat when heated with sodium hydroxide(NaOH), sodium salt of fatty acid and glycerol are formed. This process of preparing soap is called saponification.
Vegetable oil or Animal fat + Sodium hydroxide Saponification⟶ΔGlycerol + Sodium salt of fatty acid (Soap)