Soap is a sodium or potassium salt of a fatty acid(stearic acid, oleic acid, palmitic acid). Sodium soap is present in washing soap, while potassium soap is present in bathing soap.
Preparation of soap:
On heating with sodium hydroxide, vegetable oil or animal fat forms a sodium salt of fatty acid and glycerol. This process is known as saponification.
vegetable oil or Animal fat + Sodium hydroxide Saponification⟶Δ Glycerol + Sodium salt of fatty acid(Soap)