To understand condensation, one must first understand a couple of other concepts. Humidity refers to the amount of water vapor in the air. Relative humidity is a measure of the amount of water vapor in the air compared to the maximum amount possible at a given temperature. Air with a relative humidity of 50% is holding half the total amount of water vapor it is capable of holding at that temperature.
The amount of water vapor that air can hold depends on the temperature of the air. If the air temperature decreases, the maximum amount of water vapor the air can hold is reduced. If air at 70°F and 50% relative humidity is cooled to 52°F, the relative humidity will reach 100% and condensation will begin. The "dew point" is the temperature at which air saturation occurs, and condensation begins.
If air at 100% humidity is cooled, condensation will form as fog in the air or on surfaces at or below this temperature. This phenomenon may be observed on a cold winter day when you "see your breath" in the air; your warm breath is cooled enough to condense part of its water vapor, producing the tiny water droplets as fog.
A similar process occurs when an air-water vapor mixture flows through walls and ceilings of a home. The air is cooled as it moves through the thickness of the building envelope.
When moisture laden air reaches its dew point, condensation will occur if it is cooled to a lower temperature. The dew point for a given temperature of air from the home varies according to the amount of humidity in that household air.
If the dew point is above 32°F, condensation will form as a liquid. If the dew point is colder than 32°F, the water vapor will condense and immediately form frost or snow.