Air can only hold a certain amount of water vapor. That is it can hold an infinite amount of water. Warm air can hold more water than cold air. Dew and Frost are forms of condensation on solid surfaces by contact. For condensation to occur air has to cool to its dew point.
Cold material is more dense.
As it rises it undergoes adiabatic temperature changes. Adiabatic means that there is no heat exchange with surroundings. Clouds are visible concentrations of water droplets or ice crystals in air. The air must contain some moisture for it to condense water droplets or ice crystals. That condensation will take place at the dew point and to reach the dew point the air must cool.