Here's why:
* Temperature is a measure of the average kinetic energy of molecules. When a liquid cools, its molecules slow down, and their kinetic energy decreases.
* At the freezing point, the molecules have just enough energy to overcome their intermolecular forces and transition from a liquid to a solid state. The specific freezing point depends on the substance in question.
Of course, pressure also plays a role in the freezing process, but for most everyday situations, the change in pressure is negligible.