Formation of a lipid by condensation
Fats and oils (lipids) are made up from sub-units: fatty acids and glycerol.
Stearic acid (C17H35COOH) is an example of a saturated fatty acid,
because there are no double bonds in its carbon chain.
Glycerol is a trihydric alcohol, having 3 -OH groups.
In the animation below, 3 molecules of fatty acid (stearic acid) combine with 1 molecule of glycerol, with the removal of 3 molecules of water (blue). Note that both glycerol and carboxylic acids have -OH bonds, which together contribute 2 hydrogen atoms and 1 oxygen atom to form the water. Three ester linkages (green) are formed as a result.
The resulting compound (glyceryl tristearate - C57H110O6!) is also called a triglyceride, or a neutral fat. Note that the molecule has a large number of carbon atoms with associated hydrogen atoms (as in hydrocarbons), and no -OH groups.
This explains why fats do not dissolve in water, and also the large number of C-C and C-H bonds explain why lipids are a high energy store.
Unlike the comparable situation in carbohydrates and proteins (the condensation of sugars into polysaccharide and amino acids into polypeptides), in lipids the condensation reaction is not capable of proceeding beyond the stage shown here, because there are only 3 sites for fatty acids to attach to glycerol.