The 3 states of matter – solid, liquid and gas.
In general, when a body is heated, it expands and volume increases. The mass remains the same. Since density = mass/volume, its density decreases (less dense). For instance, warm air rises as it is less dense. In terms of kinetic theory, the particles will increase in kinetic energy. The average spacing between the particles increases (assuming not in a closed container).
Likewise, when a body is cooled, the opposite occurs. The body contracts and volume decreases. It becomes denser.
Due to the differences in particles arrangement of solid, liquid and gas, each expands by different amount when heated and vice versa. Which expands the most when heated and contracts the most when cooled?
The following demonstration of the ‘Pee Boy’ is a good video to show the concepts.
The tiny hole at the penis is too small for any water to enter on its own. So using thermal transfer in the different states, the following steps are taken: