Its h-bonding, the prime place it occurs in water, hence the water molecules draw closer and are more dense.
When water freezes, it forms crystal lattices which expand and prevent h-bonding and therefore its less dense.
When water evaporates, its a gas and obviously is less dense.