To affect something is to change or influence it. To effect something is a rather formal way of saying to make it happen. Confusingly, either may produce an effect or result. (An affect is a technical term in psychology.)
• The stability of the wall was affected by passing Lorries.
• The demolition of the wall was effected by the detonation of a charge of dynamite.
The dynamite did not just affect (influence) the demolition of the wall: it caused it.