There are literally thousand of kinds of molds and mildews that grow on virtually every kind of organic material, consuming the material in a process we call rot. While this process is essential to recycle nutrients back into the soil, its obviously undesirable in buildings, especially since molds often produce compounds that are toxic to humans. Given that mold spore are both ubiquitous and long lived, the only effective way to prevent mold is to keep water out so it can't grow. This means not just liquid water from rain, but to keep any water vapor from becoming liquid water. We have additional reasons to control humidity: High humidity promotes the growth of dust mites and mold inside the house, and low humidity causes dry skin and nasal passages.
While buildings have always done a passable job of keeping rain out, they've never managed water vapor because in most climates, a building with a lot of air leakage doesn't need to--problems don't occur until the air leakage is reduced or air conditioning is added. Because cold air has a low absolute humidity (see discussion below on humidity), when warmed the relative humidity is very low--and any added moisture from human activity is quickly removed by air leaks. In humid summers, relative humidity rarely goes above 90%, so as long as there is no air conditioning, there is no surface cold enough for condensation, and hence no mold--expect of course in basements, where mold and mildew is often widespread. These buildings-especially in climates where the humid summer is somewhat short lived, often have very long lifetimes--the tradeoff being that they were bone dry and drafty in the winter, and hot and sticky in the summer, and the further north you go, the bigger an energy hog they were.
As we have tightened up buildings to save energy and reduce cold drafts, the reduced airflow has allowed indoor humidity from human activities (breathing, cooking, showers etc) to build up and cause mold growth in some buildings. This has led to two strategies: first we've added ventilation so that the indoor humidity never gets very high, and second we design our buildings to drastically reduce the chance than any air leak will result in water condensation within the buildings. In hot-humid climates where air conditioning runs frequently, it may be necessary to add a dehumidifier to keep the indoor relative humidity below 70%.
The goal of ventilation it to keep the indoor relative humidity in the range of 30% and 60%. Below 30% skin, nose and lips tend to dry out. When indoor humidity goes much above 60%, the risk of condensation also goes up, and hence the risk of mold and mildew. Note that the air is filled with dust, and dust consists largely of tiny particles of cellulose worn off fabric or wood, bits of skin and hair and starchy food particles. Given dust sticks to virtually every surface, and mold grows on virtually every organic material, it explains why you get mold on tile when the tile surface is inorganic. Because many building materials and furnishings will absorb water, short lived excess water vapor can be absorbed and later re-emitted. Problems with mold usually only occur when the indoor relative humidity stays above 60%--in particular above 70%,
Once the building's relative humidity kept range, the next step is to prevent condensation, which happens when water vapor is cooled to the point it hits 100% relative humidity. The concern here isn't just that its cooled enough to condense, but that the airflow (or moisture flow) gets stopped or slowed by a surface that has low or no permeability--that is, its fine if the water vapor passes outside fast enough that inside surfaces stay dry.
Windows are often the first place condensation shows up, and as long as the condensation if brief (for example only part of the day, and only on the coldest days of the year), no mold is likely. If its more, then the only solution is to increase the ventilation rate or use a dehumidifier (although higher ventilation, especially with an HRV or ERV will likely use less energy and cost less).
For assemblies (walls etc), we either put a vapor barrier at a place that is always warm enough so no condensation happens, or we simply reduce air flow thru the wall to a very small amount.
Finally, we want to avoid solar driven moisture into the building.
The details of doing these things are all in the climate control part of the construction section.
Indoor humidity will generally be related to average outdoor humidity and the temperature difference between inside and out--the higher the ventilation rate the closer the correlation will be. Given that even a very tight building will change all of its air at least once a day, the main reason indoor and outdoor humidity don't fully correlate is due to moisture generated by occupants--ie breathing, bathing, cooking and of course the work of humidifiers and de-humidifiers. Still tighter buildings will respond to outdoor humidity changes slower than leaky ones.
Cold air contains1 very little water, while warm air contains quite a bit (see box below on relative humidity). Air colder than around 20°F (-6°C) will contain almost no water, while air above 95°F (35°C) holds a very large amount. This means that if the air is very cold and dry--for example 0°F (-18°C) and 30% relative humidity when warmed to 70°F (21°C) will have a relative humidity of less than 5%. Even moderately cold air at higher humidity will still result in fairly dry indoor air--for example 32°F (0°C) at 80% will result in indoor air at around 20% relative humidity. If its not too cold, and the ventilation rate isn't too high, occupant activity can bring the relative humidity into the more comfortable 30% range, but if not you might want to consider a humidifier.
Warm air contain large amounts of water, so when cooled to room temperature you rapidly risk having indoor air at the dew point--ie water condensing on surfaces. If the warm air isn't too humid, for example 90°F (32°C) at 55% relative humidity, the indoor humidity at 75°F (23°C) will rise to approximately 90%. If the outside air is either warmer or more humid, the indoor air will certainly hit 100% humidity and water will begin condensing on cooler surfaces. An occupant activity will only bring the indoor humidity even higher, so in hot humid climates with air conditioning you will likely want a dehumidifer. Note that a house heavily shaded by trees can be 10-15°F (6-9°C) cooler than outdoors, and hence can have similar mildew problems as an air conditioned house. In hot dry climates, moisture is generally not a problem --at least until monsoon season: 105°F (41°C) air at 15% humidity will still only result in a bit under 40% humidity at 75°F (23°C), but at 60% relative humidity, will result in 100% RH.
Mild humid air, for example in California's fog belt can also result in high indoor humidity because the average outdoor humidity is high and the temperature different between inside and out can be so small enough that indoor humidity will be very little different from outdoor.
The simple explanation is that relative humidity refers to the percentage of water vapor in the air as compared to the maximum amount of water vapor the air "hold". Its is called relative because the amount of water air can "hold" changes dramatically with temperature. Cold air can "hold" very little water and warm air can hold quite a lot. Condensation occurs when warm air is cooled to the point where the relative humidity would exceed 100%.
The word "hold" is in quotes above, because air doesn't really hold water--water vapor is a gas that is a component of air. The more accurate definition is that relative humidity is the percentage of water vapor in a given volume compared to the maximum amount that volume will hold at a given temperature. While the difference may sound subtle, the key is that its the space that hold the water, not the air--the amount of water vapor in a given volume would be the same in a vacuum. At a given temperature water molecules both evaporate and condense at a specific rate, and that rate determines the total water in the air. Given a large enough supply of water and enough time, the rate of evaporation and condensation will reach equilibrium and the volume of space will be at 100% relative humidity. Given a limited water supply, limited time or changing conditions, the relative humidity will be less than 100%.
The corresponding term absolute humidity is the weight of water in a given volume (ie not a percentage), often given as the weight of water per pound of dry air. Air at 30F and 100% humidity would have .003lbs water/lb dry air, while air at 90F and 100% relative humidity would have about .03lbs water/lb dry air--that is about ten times more absolute humidity.
The relative humidity in a given volume is dependent on absolute humidity and temperature, and can be calculated from a psychrometric chart (the actual math is quite complex, so hence everyone uses either a chart or a computer calculator). As temperature changes the absolute humidity won't change unless the temperature cools to the dew point (the point of 100% relative humidity). Warming air will reduce the relative humidity, while cooling air will result in higher relative humidity until 100% is reached, and from that point on the absolute humidity will reduce while the relative humidity stays at 100%.
Although the chart is a little complex, using it to calculate changes in relative humidity is easy. To figure out what your indoor humidity would be based only on outdoor temperature and outdoor relative humidity, you find the outdoor temperature at the bottom, follow that line straight up to where it meets the relative humidity curve, then move right or left until you hit the indoor temperature, then extrapolate the new relative humidity by finding the nearest curves. The red lines in the example (right, click on image for larger version) are lines of constant water content, but changing temperature. Where they hit the leftmost curve is the dew point. It can be read both ways, so using the lower most red line, we find that air at 23F and 100% humidity, will be at 15% humidity when brought to 70F, or reading in reverse, if the room temperature air is 15% humidity, it won't condense till 23F. Moving further to the third red line from the bottom, we see that 70F air with 60% relative humidity will start condensing at 55F: reading that in reverse, the implication is that 55F air at 100% humidity will result in somewhat high interior humidity even at 70F indoors, and that this situation is not uncommon in the fog belt on the US pacific coast. Finally, at the top we find the 95F at 60% humidity will condense at about 75F.
Water vapor, being a gas is a component of air, and so any air movement means water vapor movement. Even air moving very slowly, say at slow walking pace (1 mph or 1.5kph) will move far more moisture than vapor diffusion--the later moves more at speed that is similar to evaporation.
Whenever there is a difference in vapor pressure (absolute humidity) between inside and out, the vapor will want to move from the area of higher vapor pressure to the one of lower vapor pressure. This generally means that vapor moves from warm to cold, since higher temperatures allow for greater absolute humidity (eg 70F air at 40% has more water than 30F at 100%. See above for more on humidity). That means that in most climates vapor diffusion will be seasonal, or at least change direction.
Keep in mind that because vapor pressure wants to even out, unless there is some driving force, indoor and outdoor absolute humidity will be very similar--the relative humidity will be different due to the temperature difference. This will be especially true when there is either high amounts of air leakage or ventilation.
There are four driving forces making the absolute humidity different are:
During heating, if the building were unoccupied, the colder it is outside, the lower the indoor relative humidity will be. Human activity will raise the indoor humidity as will a humidifier, while ventilation and infiltration will dilute that somewhat--the caveat being that ventilation via and ERV will maintain indoor humidity more than other ventilation types. Historically building were so leaky that winter indoor humidity was very low. As building tighten up, there is less dilution, so indoor humidity tends to be higher. Although tight buildings are ventilated, usually the ventilation rate is far less than what a leaky building experiences during winter.
During cooling, even an unoccupied building can experience condensation--all it takes is for the outside air to be warm and/or humid enough. Human activity will add additional indoor moisture, making the problem worse. An ERV can somewhat keep outdoor humidity outside, but its moisture transfer ability is limited, hence a de-humidifier is the only way to lower the absolute humidity so that the relative humidity stays below 100%.
Vapor diffusion is generally a very slow process because most typical building materials are not especially permeable. How much vapor moves depends on the permeability of the material and its thickness, as well as the duration of the difference in vapor pressure.
When vapor moves thru an assembly that is also a moisture reservoir (eg. wood frame, straw bale) the materials will absorb some of the moisture--potentially quite a large quantity--without any condensation. If this absorption gets too high there can still be mold even without visible condensation, so there is a limit to how much they can store. The net result is a delay of any mold problems and if the delay is long enough so that the vapor drive stops, the assembly can then dry out.
Note also that many wet materials will be effectively more permeable than dry ones. This can be a great advantage if the vapor driving force stops as it means that the wetter they are, the faster they dry.
The vapor retarder page in the construction section has more details.
Healthy by Design, David Rousseau & James Wasley, Hartley & Marks, 1997
DOE guide to moisture control:
https://energy.gov/energysaver/moisture-control
Building Science Corp guide to moisture control:
http://www.buildingscience.com/buildingphysics/moisturecontrol
Read about un-vented roofs on the building science corp site: http://www.buildingscienceconsulting.com/resources/roofs/roofs_unvented.htm
Read about roof venting from Home Energy magazine:
http://www.homeenergy.org/archive/hem.dis.anl.gov/eehem/99/991111.html
Read Building Science Corp general building info:
http://www.buildingscience.com/doctypes/designs-that-work
1: while air doesn't really "hold" or even "contain" moisture, its just easier to think about it that way. See the sidebar on relative humidity.
1: California builders put sand on top of the poly sheet, which because it can hold a lot of water which is now trapper between the poly sheet & the slab, will have no choice but to exit over time via the slab. Apparently the builders get away with this so often that it is still standard practice. See http://www.buildingscience.com/documents/insights/bsi-003-concrete-floor-problems/