Modest mammals – cynodonts – evolved about the same time as dinosaurs (260 MYA), but dinosaurs were the dominant terrestrial animals for well over 100 million years. They suppressed the ascent of other large life, most notably mammals, who subsided in the shadow of the dinosaurs. This turned out to be fortuitous for mammals. Their small size enabled them to thrive while large dinosaur species were struggling with climate change.
By 208 MYA, there were arboreal rodents the size of squirrels. Some glided among the trees. They were no competition, nor much of a food source, to the giant reptiles.
Nascent mammals were usually generalized insectivores. As an aspect of their later radiation, mammalian diets often specialized to specific foods.
Early mammals underwent a rapid burst of evolutionary diversity during the mid-Jurassic (200–145 MYA). Various branches evolved tree-climbing, swimming, and burrowing, which afforded a subterranean lifestyle. Then the pace of innovation slowed.