Freezing occurs when a substance loses enough heat energy to change from a liquid to a solid state. The molecules in the liquid slow down and come closer together, forming a crystalline structure.