Confounding occurs when a third variable is associated with both the exposure and the outcome, potentially distorting the observed relationship. For instance, age might confound the relationship between physical activity and heart disease because older individuals are generally less active and more prone to heart disease. Confounding can be controlled through study design (e.g., matching, randomization) or statistical methods (e.g., stratification, multivariable analysis).