In chemistry, soap is a salt of a fatty acid. Soaps are mainly used as surfactants for washing, bathing, and cleaning, but they are also used in textile spinning and are important components of lubricants. Soaps for cleansing are obtained by treating vegetable or animal oils and fats with a strongly alkaline solution. Fats and oils are composed of triglycerides: three molecules of fatty acids attached to a single molecule of glycerol.
The alkaline solution, often called lye, brings about a chemical reaction known as saponification. In saponification, the fats are first hydrolyzed into free fatty acids, which then combine with the alkali to form crude soap. Glycerol, often called glycerine, is liberated and is either left in or washed out and recovered as a useful by-product according to the process employed.
Soaps are key components of most lubricating greases, which are usually emulsions of calcium soap or lithium soaps and mineral oil. These calcium- and lithium-based greases are widely used. Many other metallic soaps are also useful, including those of aluminium, sodium, and mixtures of them. Such soaps are also used as thickeners to increase the viscosity of oils. In ancient times, lubricating greases were made by the addition of lime to olive oil.