The story
Drop an ice cube into a glass of water. It bobs upward, leaving a small part above the surface. Many solids are denser than their own liquids. Water's ordinary ice takes the other route: freezing makes the same amount of water occupy more space.
Density is mass divided by volume. Keep the mass the same and increase the volume, and the density falls. Water expands by about nine percent when it freezes under ordinary conditions. The extra room helps explain why ice is less dense than liquid water.
The cause is hidden among molecules. A water molecule has two hydrogen atoms and one oxygen atom. Neighboring water molecules attract each other through connections called hydrogen bonds. These are attractions between molecules, not the stronger bonds holding each water molecule together.
In ordinary ice, hydrogen bonds help hold the molecules in an open, ordered structure. The arrangement keeps them farther apart on average than in liquid water near freezing. In the liquid, the network keeps changing, and molecules can fit more closely together.
An ice cube floats when the upward force from displaced water balances its weight. Because its average density is lower, it does not need to go completely underwater to displace enough water. Roughly a tenth of an ordinary ice cube's volume can remain above the surface.
This matters beyond a drink. Lakes generally begin freezing at the top, leaving liquid below. Water reaches its greatest density near four degrees Celsius, so colder water near freezing can remain above denser water underneath. The floating ice becomes a surface layer rather than piling up immediately on the bottom.
The cube's familiar position is therefore a visible clue to an invisible arrangement. Nothing special was added to make it rise. The same molecules formed a different structure, and that structure changed how much space the water used. A small glass is showing you a property that shapes entire winter lakes.