Pruning is a technique used to reduce the size of a decision tree by removing unnecessary branches or nodes, thereby preventing overfitting and improving generalization.