In chemistry, a soap is a salt of a fatty acid. Household uses for soaps include washing, bathing, and other types of housekeeping, where soaps act as surfactants, emulsifying oils to enable them to be carried away by water. In industry they are also used in textile spinning and are important components of some lubricants.
Soaps for cleaning are obtained by treating vegetable or animal oils and fats with a strong base, such as sodium hydroxide or potassium hydroxide in an aqueous solution. Fats and oils are composed of triglycerides; three molecules of fatty acids attach to a single molecule of glycerol. The alkaline solution, which is often called lye (although the term "lye soap" refers almost exclusively to soaps made with sodium hydroxide), brings about a chemical reaction known as saponification.
In this reaction, the triglyceride fats first hydrolyze into free fatty acids, and then these combine with the alkali to form crude soap: an amalgam of various soap salts, excess fat or alkali, water, and liberated glycerol (glycerin). The glycerin, a useful by-product, can remain in the soap product as a softening agent, or be isolated for other uses.
Soaps are key components of most lubricating greases, which are usually emulsions of calcium soap or lithium soap and mineral oil. 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.