Hi,
Let the training be supervised (supervised learning).
In this situation, each sample in total dataset has feature x and label y.
Usually, publicly available datasets such as MNIST and CIFAR 10/100 group all samples by labels.
So, if you sample mini batches in the way described below, some mini batches have only 1 class samples and are so biased.



 Derek:

total dataset is splitted into many tiny parts named mini-batch


On the other hand, sample mini batches at random would make your mini batches diverse.
In general, the latter makes trained model more geenralized.