Here's why:
* Thermal Expansion: When you heat a material, the molecules move faster and spread out, taking up more space. The opposite happens when you cool it. The molecules slow down, move closer together, and the material shrinks.
* Exceptions: There are some exceptions to this rule, most notably water. Water expands when it freezes, which is why ice floats. This is due to the unique structure of water molecules in the solid state.
Let me know if you have more questions!