The purpose of a cell membrane is to separate the cell's contents from the external environment. Because life evolved in an aqueous, or watery, environment, cells exist in, and contain, water. Because water and fat/oil do not mix well, membranes have developed on this basis.
Hydrophobic/Nonpolar Molecules Vs. Hydophillic/Polar
Large molecules consisting almost entirely of carbon and hydrogen atoms are called nonpolar, or hydrophobic, "water-fearing." Consisting of fats, oils, waxes and other lipids, when placed in water, they tend to congregate together, forming oily droplets. Molecules containing chemical groups with oxygen, nitrogen and phosphorous atoms have many positive and negative charges separated, which is to say that they are polar. Being polar, they mix well with water, which is also polar, and thus they are called hydrophillic, or "water-loving."
Phospholipids: A Type of Amphiphillic Molecule
The term amphiphillic refers to a molecule that has both hydrophobic and hydrophillic properties. The classic example of such a molecule is a phospholipid. The backbone of a phospholipid is glycerol, containing three carbon atoms to which other molecules can be connected by way of alcohol groups (ester linkage, in chemical terminology). When a chain of mostly carbon and hydrogen atoms called a fatty acid is connected to one or more of the three positions on glycerol, the molecule is called a glyceride. If there are three such fatty acids, it is a triglyceride, which is extremely hydrophobic. When there are two such fatty acids, it is called a diglyceride. However, if the third position is then connected to a chemical group known as a phosphate, the molecule is called a phospholipid. The phosphate group of a phospholipid, in turn, can be attached to another chemical unit, which can be highly polar. Known as the polar head of the molecule, this entity mixes well with water, while the tail of the molecule, made of two fatty acids, is very hydrophobic.
Types of Phospholipids
While all phospholipids consist of a hydrophobic tail, made of fatty acids, and a polar head, they differ based on the lengths of type of fatty acid chains in the tail and the component of the polar entity attached to the phosphate group in the head. One example of a class of phospholipids is the phosphatidylcholines, in which the chemical group choline is the polar entity attached to the phosphate.
Synthesis of Phospholipids
Synthesis of phospholipids takes place in the cytoplasm of cells next to a membrane entity called the endoplasmic reticulum (in the division of life known as eukaryotes). The endoplasmic reticulum is covered with enzymes that put the phospholipids together inside vesicles. These vesicles later bud off from the endoplasmic reticulum and move to the cell membrane, where they deposit the phospholipids.
Formation of the Trilayer
If there are a small number of phospholipids, tails congregate with tails outside, forming a micelle, a sphere with a hydrophillic outside in water and a hyrdophobic interior. If the volume of phospholipids increases, however, membranes form. The cell membrane is known as a trilayer because it consists of a layer of hydrophobic tails of phospholipids sandwiched between two layers of hydrophillic heads. Often, however, it is called a bilayer, because it is made of two sets of phospholipids. Because each phospholipid consists of a hyrdophobic tail and hydrophillic head, to escape from the watery envrionment, tails of many phospolipids line up together and face the tails of a second layer of similar molecules. Thus, one layer of hyrophillic heads becomes the outside of the cell membrane and another layer of hydrophillic heads becomes the inside of the cell membrane.