Soap is a mixture of sodium salts of various naturally occurring fatty acids. Air bubbles added to a molten soap will decrease the density of the soap and thus it will float on water. If the fatty acid salt has potassium rather than sodium, a softer lather is the result. Soap is produced by a saponification or basic hydrolysis reaction of a fat or oil. Currently, sodium carbonate or sodium hydroxide is used to neutralize the fatty acid and convert it to the salt.
General overall hydrolysis reaction:
fat + NaOH → glycerol + sodium salt of fatty acid
Although the reaction is shown as a one step reaction, it is in fact two steps. The net effect as that the ester bonds are broken. The glycerol turns back into an alcohol (addition of the green H's). The fatty acid portion is turned into a salt because of the presence of a basic solution of the NaOH. In the carboxyl group, one oxygen (red) now has a negative charge that attracts the positive sodium ion.
Types of Soap
The type of fatty acid and length of the carbon chain determines the unique properties of various soaps. Tallow or animal fats give primarily sodium stearate (18 carbons) a very hard, insoluble soap. Fatty acids with longer chains are even more insoluble. As a matter of fact, zinc stearate is used in talcum powders because it is water repellent.
Coconut oil is a source of lauric acid (12 carbons) which can be made into sodium laurate. This soap is very soluble and will lather easily even in sea water. Fatty acids with only 10 or fewer carbons are not used in soaps because they irritate the skin and have objectionable odors.
Charles Ophardt (Professor Emeritus, Elmhurst College); Virtual Chembook