Two terms that are frequently confused are moderation and mediation:
Definitions of moderating and mediating:
A mediating variable is one that accounts for or alters another relationship. A strict definition is that the mediating variable has to greatly reduce or even eliminate the relationship. A more lenient definition is that it affects the relationship. I favor that more lenient definition. A moderating variable is one that interacts with a variable. An interaction means that the relationship between one independent variable (IV) and the dependent variable (DV) is different at different levels of the other IV.
Examples of mediation:
Mediation example 1: There is a strong positive relationship between the amount of firemen sent to a fire and the amount of damage done by the fire. Does this mean we should not send firemen to a fire? No. The relationship is mediated by the size of the fire! Bigger fires get more firemen and also do more damage. If you add the size of the fire to the model, the relationship between firemen and damage reverses.
Here’s a slightly trickier one:
Mediation example 2: Among children in the early elementary grades, there is relationship between astrological sign and vocabulary. Are children born in different months different in IQ? No. Schools (at least in the USA, I don’t know the situation in other places) have birthdate cutoffs, so children born in different months (and hence, different signs) will have been in school for different lengths of time, and, in the early years, that matters. 11 months of school vs. 1 month of school.
Example of moderation:
If you are trying to predict the risk that a person has HIV, then two important variables are the person’s sex (Male, female, other) and sexual orientation (hetero-, homo-, bi-, other) but these interact. The effect of being homosexual is much greater for males than for females.
Further notes and information:
More complex relationships are possible; there can be three way (or higher) moderation and mediation and moderation can co-exist.
There are two broad approaches to testing moderation and mediation. The older method is put forth in the seminal article by Baron and Kenny and treats moderation and mediation as either existing or not. A newer approach (especially to mediation) is that of MacKinnon.