What is the purpose of 'oversampling' when the test set is still unbalanced? I understand that both training and testing sets should have the same distribution and also understand that we should not touch the test set (in terms of oversampling). But we know that oversampling the training set (specifically in multiclass classification) totally changes the distribution of the training set. For example: 


The distribution of my training set before oversampling is: 90%, 5%, 3%, 2% [for classes A, B, C, and D]
The distribution of my training set after oversampling is: 25%, 25%, 25%, 25% [for classes A, B, C, and D]
The distribution of my training set using stratified cross-validation is: 90%, 5%, 3%, 1% [for classes A, B, C, and D] -->as stratifying keeps the distribution of the original data.


Could someone please explain why do we use oversampling when both training and testing sets need to have the same distribution?
Could someone please explain why do we use oversampling when both
  training and testing sets need to have the same distribution?


We use it because train and test set does not have to have the same distribution of labels. What is important is that the test set comes from the same distribution as your "real" data so that it provides a reliable measure. Post split the training set can be sampled as you see fit, as long as the results are good on your test set.