So as I understand it a confounder is associated with both the response and explanatory variable, and explains any association between the explanatory and response variable. However a moderators change the effect (in size or direction) of the explanatory variable on the response, so is it the case that every confounder is also a moderator as confounders also change the effect of the explanatory variable on the response variable?
To add on to Ed's model-based explanation, here's a purely causal one (no specific statistical models required).
A confounder is a variable that causes both the predictor of interest and the outcome. (Association with the predictor and outcome is not sufficient for a variable to be a confounder). A moderator (also known as an effect modifier) is a variable for which the effect of the predictor on the outcome varies. Some moderators are also confounders, but not if they don't cause the predictor. For example, mediators (variables caused by the predictor that also cause the outcome) are not confounders but may be moderators. Variables completely independent from the treatment (e.g., all pretreatment variables if the predictor is randomized) are not confounders but may be moderators.
One thing to note is that the presence of moderation depends on the effect measure considered (i.e., risk difference, risk ratio, odds ratio, etc.). If the predictor causes the outcome, then any variable that also causes the outcome that is not a moderator on one scale will be a moderator on another.
The presence of moderation means means that the strength of relation between predictor X and outcome Y depends on the value of predictor Z. Confounders bias causal parameter estimates but are compatible with fixed effects models, so a confounder need not be a moderator. Moreover, a moderator Z need not be a confounder if Z is orthogonal to predictor X and is included in the model.