Decision trees handle imbalanced datasets by using techniques such as class weighting, upsampling, or downsampling to give equal importance to minority classes.