In machine learning we often need to shuffle data. For example, if we are about to make a train/test split and the data were sorted by category beforehand, we might end up training on just half of the classes. That would be bad.