When heat is applied to water, the transfer of energy causes the water molecules vibrate at a quicker pace. As the heat increases, the molecules get further apart, causing the water to change form from a liquid to a gas (aka vapor). As the molecules cool, they lose the energy from heat that was applied, causing the molecules to vibrate at a slower pace. As the energy is lost, the water molecules to come closer together, resulting in water returning to a liquid state.