Most substances take up less space in their solid states than when they are in liquid form; water is an exception to this. In solid form, atoms of a substance are close together. In liquid form, atoms can spread out a bit, and chemicals expand significantly when they are in gaseous form. However, when water freezes, it forms a crystalline grid that causes it to expand.
The crystalline structure of ice makes it susceptible to cracking and shattering, but it also gives it more strength. Pipes are designed to withstand the force of ice formation, but few are able to withstand the pressure imparted when a significant length of ice forms.
Water's expansion when it undergoes a phase transition to a solid is part of the reason why ice floats, but there are other causes. Water will often trap air when it freezes and form a strong barrier than prevents this air from being released. Ice can also have a hollow core, and it will remain buoyant if this core is not breached.Learn more about Plumbing