The thermostat blocks the flow of coolant to the radiator until the engine has warmed up. As the engine and coolant temperature heat up, the wax begins to melt when the temperature reaches the waxes melting range. As the wax melts, it expands. This expansion presses in on the rubber boot which in turn squeezes the piston upward. This upward motion causes the thermostat to open, allowing the coolant to flow through the engine.
In other words, the thermostat provides a securely sealed, heat responsive assembly that keeps engine temperatures within original equipment specifications.
More info: Thermostat Catalog