Soap is a surface active agent referred to as a surfactant. All surfactants are molecules that contain both polar regions and non-polar regions. The polar regions are hydrophilic ("water loving"), while the non-polar regions are hydrophobic ("water fearing") or lipophilic ("fat loving"). The polar regions will readily dissolve in water, while the non-polar regions will tend to associate with each other. Oils and fats, which do not dissolve in water, will also associate with the non-polar regions of the surfactants. This process results in dispersion of these molecules leading to the cleaning properties that we associate with soap.
Types of Soap
The classical type is also known as lye soap. Lye soap is prepared by the saponification of animal fat or vegetable oil. Saponification is a chemical reaction between lye, which is primarily sodium hydroxide, and the fat/oil, which are triglycerides. The products of this reaction are a complex mixture of fatty acid salts. Each of these salts contains a polar, hydrophilic head, called a carboxylic acid salt, and a non-polar, hydrophobic tail. The nature of the tail determines the identity of each compound in the soap. The ratio of each compound will primarily influence the temperature at which the soap will soften or melt.
The main issue with lye soap is the formation of soap scum. Calcium and magnesium ions, which are present is hard water, will readily react with carboxylic acid salts to form insoluble complexes. To address this issue, other types of soaps have been developed. The most popular are referred to as non-ionic surfactants. Like lye soap, non-ionic soaps contain both hydrophilic heads and hydrophobic tails. However, unlike lye soap, these compounds do not have carboxylic acid groups. As such, the compounds do not react with ions in hard water. Non-ionic surfactants may be prepared from fats and oils. For example, sorbitan monooleate and polysorbate 80, which are common ingredients in many shampoos, are prepared from olive oil. Other soaps, Triton X-100, are derived from petroleum. The polar heads for non-ionic surfactants are be prepared using either a sugar, e.g. sorbitol, ethylene oxide, glycerin, or a combination of these components. Depending on the weight ratio of the polar components to the non-polar components, referred to as the hydrophilic-lipophilic balance or HLB, determines the water solubility and foaming potential.
A third type of surfactant is the detergent. Like lye soap, these compounds are ionic. The nature of the ionic group has been modified to prevent the formation of soap scum. The main types of groups are the sulfonic acid group, which is used in sodium lauryl sulfate (SLS or SDS), and the phosphoric acid group. Detergents are known for their high water solubility and foaming potential.
A fourth type of surfactant is cationic. Like detergents, these compounds will not react with the ions in hard water. However, these compounds do not have a high foaming potential. The polar group is typically a quarternary amine, which tends to have antibacterial properties.