Many of the common phenomena of weather - clouds, frost, fog and rain - are due to the cooling of air and the consequent condensation of excess water vapour. Air is cooled by two main processes: cooling by contact (usually with the Earth's surface); and cooling by uplift.
A common form of contact cooling is radiation cooling. When the Sun sets, the Earth and any other radiating body upon it continue to radiate heat from their supplies. With no heat from the Sun to replenish their stocks, their temperature falls. Maximum loss of heat occurs under clear skies. As surface temperature falls the air in closest contact with it begins to cool. Eventually, the surface air will cool below its dew point temperature, and begin to condense water vapour out as dew. When the dew point of the cooling air is below 0°C, hoarfrost results from radiation cooling instead. Condensation then occurs directly as a crust of white crystals. Sometimes a much thicker layer of moist air may be cooled. Condensation then occurs throughout, giving rise to fog.
Usually wind serves to prevent or restrict the formation of dew, frost or fog. This is because a steady flow of air over the cooling surface does not remain in contact with the ground long enough to cool below its dew point for condensation to occur. The one occasion when wind does not deter condensation is when warm air from different sources passes over a much colder surface. Advection cooling, as it is known, is a common source of sea fog in coastal areas, when warmer sea air comes inland passing over colder land.
Clouds and rain are caused by cooling from mechanical uplift. There are three main ways by which uplift of air can occur: by convection; at fronts; and by orographic (mountain) uplift. In each case, the rising air is forced to cool as it expands, consuming energy in the process. Cooling below the air's dew point releases condensation first as cloud, and if uplift and cooling continues, as rain, hail or snow.