Imagine that the air is coffee, and that the humidity is sugar. You will agree that the sugar is better dissolved in a warm coffee than in a cold one. It is the same with the air: the warmer the air the greater its capacity to absorb humidity.
Two condensation examples
The moist air having to pass over a mountain becomes colder. Its ability to keep moisture decreases and water passes from a gaseous form to a liquid form. This is condensation, and in our case rain.
Another example is your ice-tea served on a warm afternoon by the sea. The warm and humid air touches the cold surface of your glass, and small drops start to form on its surface.
Condensation on the air-duct
So, when do we have condensation in ventilation airducts? The best example is when cold air is conveyed in a non-insulated steel duct. The warm air touches the surface of the duct, gets colder, looses its propensity to hold moisture, and drops start to form on the surface of the air-duct.
Condensation inside the air-duct
The opposite can also happen. Imagine being in the winter and that you have an outside, non-insulated ventilation duct carrying warm, moist air (for a room adjacent to the building, for example). The warm air touches the non-insulated duct walls and cools down. This temperature decrease reduces its capacity to retain moisture in a gaseous form and condensation occurs. This situation can have disastrous consequences for the hygiene and the air quality (formation of molds, bacteria, etc.)