Mammals survived by being smaller and more adaptable. They thrived in niches dinosaurs couldn't fill after the asteroid impact.
Mammals diversified quickly to fill various roles, from small insectivores to larger herbivores and carnivores. This adaptability was key to their survival and eventual dominance.
Pro tip: The asteroid impact created a "window of opportunity" for mammals that lasted millions of years before they began to outcompete dinosaurs in size and diversity.