This also explains why evaporation cools down (like when you sweat): the molecules with the highest temperature are the ones evaporating, so the average temperature decreases as those high-temperature molecules leave the system. Only the relatively colder molecules are left behind - thus it cools as a whole.
The main principle at work here is the enthalpy of vaporization. When matter changes state, there is an associated amount of energy that is absorbed or released - in the case of vaporization, energy must be absorbed. So when sweat forms on your skin and evaporates, it absorbs heat energy from your body in order to undergo that state change.
For water, the energy involved here is remarkably high, much higher than the energy stored by a few degrees difference in temperature. For example, if you wanted to boil off 1kg of water, it would take about 300 kJ to bring the temperature up to boiling from room temperature and over 2000 kJ to boil it all into steam.
@FlyingSquid “Ok, then. That was always allowed!”