AS THE SUN HEATS THE OCEAN, water molecules at the surface jump around in random directions. Some jump up, and if they’re excited enough, they stay up, transferring heat energy from the water to the air. Voilà, evaporation. Because of small variations across the water’s surface, the process is uneven—more evaporates in some places than in others. At each of those spots, there’s a parcel of air that has a higher percentage of water vapor (which is lighter than air) than the air around it. This causes the air to rise in a process called convection.
Some version of this process is happening everywhere, all the time. It’s what makes clouds. The warm, moist air resulting from evaporation rises into lower-pressure air and expands. That costs energy, and the air cools (what’s called adiabatic cooling). The water vapor molecules, now more lethargic, get stuck to tiny dust particles called condensation nuclei, in the process returning to a liquid state, and the result is a cloud. The air within the cloud continues to rise, encountering colder air. More condensation occurs, the condensation nuclei start sticking together and coalescing into droplets, and you get rain. As they fall, the raindrops partially evaporate, which cools the air within the cloud the same way evaporating sweat cools your body.
In a typical thunderstorm, that cool air sinks all the way to the surface and spreads out, what meteorologists call a downburst. Replacing warm surface air with cool air effectively shuts off the convection that created the storm in the first place. The sky clears and it’s over.