At the end of the Mesozioc era a mass extinction killed all dinosaurs and most of life on earth.
Mammals survived because at the time they were small enough to burrow underground to escape the elements, and they had smaller bodies so they didn't need as much food