Stearic acid is mainly used in the production of detergents, soaps, and cosmetics such as shampoos and shaving cream products. Soaps are not made directly from stearic acid, but indirectly by saponification of triglycerides consisting of stearic acid esters. Esters of stearic acid with ethylene glycol, glycol stearate, and glycol distearate are used to produce a pearly effect in shampoos, soaps, and other cosmetic products. They are added to the product in molten form and allowed to crystallize under controlled conditions. Detergents are obtained from amides and quaternary alkylammonium derivatives of stearic acid.
Stearic acid helps water and oil mix, the ingredient is also added to many liquid cosmetics and skin and hair care products in low concentrations to function as an additive rather than an active ingredient or cleansing agent. In these products, stearic acid helps prevent the formulas from separating into liquid and oily layers. As a result, products that contain stearic acid require less shaking prior to use and remain more potent when stored for extended periods of time.
Source: wikipedia, skinstore.com