Pruning removes parts of the tree that provide little predictive power, helping to prevent overfitting.