Most liquids shrink as they cool and shrink again as they solidify, so their solids sink. Water gets denser as it cools only until about 4 °C. Below that, it starts to expand.
In ice, hydrogen bonds hold each water molecule in a rigid hexagonal lattice with a lot of empty space. The same number of molecules takes up more volume as ice than as liquid water, which is why ice cubes bob at the top of your glass.
In winter this quirk protects lakes. Ice forms at the surface and insulates the water below, while the densest water — near 4 °C — settles to the bottom, where fish and other life can survive until spring.
