Here's how it works:
* Water vapor (gas) in the air comes into contact with a cold surface, like a windowpane or a blade of grass.
* The cold surface causes the water vapor to lose energy, causing the molecules to slow down and clump together.
* The molecules then directly transform from a gaseous state to a solid state, forming ice crystals (solid).
This process is called deposition and is the opposite of sublimation, where a solid changes directly into a gas.