Why does heat cause matter to expand, Physics

Why does heat cause matter to expand?

Water contracts as it cools, like all other liquids, unless it reaches a temperature of about 4 degrees Celsius, at which point it enlarge and starts to form into crystals, expanding approximately 9 percent.