There are a lot of questions here regarding when to do class balancing, or what to expect of class balancing or whether unbalanced classes are an issue at all.
Apparently the "consensus" among most of the top answers on these questions is that, for binary classification models:
Balancing techniques are essentially an "old habit", back when estimating models was much more computationally expensive.
If a model is well specified, then class imbalance shouldn't be a problem at all.
Class balancing techniques introduce bias and overall make models perform worse.
Most of class balancing discussion is assuming that accuracy is the KPI to optimize and a decision threshold of 0.5 (considering that classification models output a probability from 0 to 1)
Now, I've seen plenty of examples online (Kaggle, medium posts, etc..) implementing SMOTE, undersampling, class weights and such. Most results I've seen improve recall at the cost of degrading precision for a specific threshold, but don't really change or improve ROC AUC.
However, I've also seen some examples (even though) simulated where such techiniques actually improve ROC AUC (and even PR AUC) dramatically, such as this one.
Why is that so? If it is a consensus that inbalanced datasets are NOT a problem, then why do we have an entire sklearn python library (imblearn) dedicated to these problems and techniques? Why are these techniques so popular in learning resources? Do they work at all? Why? I can't seem to find enough evidence to any side of this matter.