When aggregate metrics (e.g., the mean, variance, etc.) are created before the training and test set split, leakage occurs.
For example, using the population average as a feature for predicting outcomes on future instances (which are part of that population).