How?
Through the process of evolution. Traits that would have gotten mammals eaten by dinosaurs before were no longer a detriment after the dinos died off.
So, mammals could get bigger, for example. That allowed them to fill certain niches. They could live in different environments than before, which allowed certain traits to survive.
REAL easy to say; REAL hard to show evidence.