Drop an ice cube into a glass of water and it bobs at the top. It seems ordinary, but it is actually strange. For almost every other substance, the solid form is heavier than the same amount of liquid, so the solid sinks. A chunk of solid wax sinks in melted wax. Water breaks the rule, and life on Earth depends on it.
The key idea is density, which describes how much matter is packed into a certain space. A denser liquid sinks below a less dense one. Most liquids become denser as they cool, because their molecules slow down and crowd closer together. Water does this too, but only down to about 39 degrees Fahrenheit (4 degrees Celsius). That is the temperature at which water is densest. As it cools further, it begins to expand slightly.
When water finally freezes at 32 degrees Fahrenheit, its molecules lock into a pattern of six-sided rings with open space in the middle. That open pattern takes up more room than liquid water, about 9 percent more. Because ice is less dense than the water around it, it floats.
Now picture a lake in late fall. Cold air chills the surface water. As it cools, the surface water becomes denser and sinks, while warmer water rises to take its place and cool in turn. This mixing continues until the whole lake is close to 39 degrees. After that, the surface water that cools further becomes lighter, so it stays on top. It keeps cooling until it freezes into a lid of ice.
That lid matters. Ice and the snow on top of it slow the escape of heat, so the water underneath stays liquid. At the bottom of a deep lake, the water often stays near 39 degrees all winter. Fish slow down in the cold water, but they can survive until spring.
If ice sank, lakes could freeze from the bottom up. Each new layer of ice would drop down, leaving the surface open to freeze again. In cold places, many lakes might freeze nearly solid, and much of the life in them could not survive. One small quirk of water helps keep entire ecosystems alive through the winter.