Sodium stearate is one of the main compounds in common soap.
To make soap, you start with beef fat. If you treat
beef fat with steam you get tallow, a mixture of fats, one of which is
a tri-glyceride containing three
stearic acid molecules attached to a glycerine molecule.
When you boil glyceryl tristearate in lye (sodium hydroxide),
you get sodium stearate and glycerine. When you remove the
glycerine, you get soap.
The sodium end of the molecule attracts water. The long
hydrocarbon chain at the other end attracts oils and fats.
Soap works by helping to break fat and oil droplets into small
pieces. The pieces are coated with the soap, with the hydrocarbon
chains attached to the fat, leaving the sodium ends dangling in
the water. The oils are now completely surrounded by water, instead
of being attached to skin or clothing, and so they wash away in