According to this recent study, the popular belief that mammals diversified after the extinction that killed the non-avian dinosaurs is incorrect; mammals diversified in the shadow of the dinos long before the extinction, and actually had a drop in diversity after it. The reason for this diversification was the evolution of angiosperms (flowering plants), which provided mammals with new food sources.
Research paper:
http://rspb.royalsocietypublishing.org/content/283/1832/20160256
Simplified version:
http://www.sci-news.com/paleontology/early-mammals-diversification-03931.html