Cell membranes are like fences with gates. The fence keeps things in the cell and keep things out of the cell. The gates can open and to close allow certain things to pass in and pass out. The lipds that make up a cell membrane have a "head" that is hydrophilic which means 'water loving' and two long tails which are hydrophobic or 'water hating'. In a water environment like the body, the lipids spontaneously arrange to make a double layer of lipid molecules where the heads face out and the tails face in. The lipid bilayer prevents the uncontrolled movement of things that are hydrophilic like salt, sugar, proteins and water across the cell membrane.