Mammals and dinosaurs coexisted for millions of years, but only mammals (and the branch of dinosaurs known as birds) survive today. According to Daryl Condon (who is affiliated with three universities including the University of Zurich) and his colleagues, this may have been due to their very different reproductive strategies.
Mammals nurture their young internally, whereas dinosaurs lay eggs, which have a strict upper size limit. A larger egg requires a thicker sturdier shell. Above a certain thickness, the embryo would no longer be able to get oxygen through that shell. This means that while a baby elephant and a baby squirrel can be vastly different in size, newborn dinosaurs must be much more similar in size. Thus, a mother elephant is about twenty times as large as her newborn calf, but a similarly sized mother dinosaur would have been 2500 times larger than her baby.
There are other ramifications of the dinosaur’s oviparous lifestyle. Mammalian babies tend to eat the same foods as their parents and are fed milk until they are able to do so. They therefore fill the same ecological niche as their parents. In contrast, baby dinosaurs might have filled completely different niches than their parents, and indeed a different niche at every stage of their development.
In fact, Condon and his colleagues propose that where a given environment could have supported many different mammalian species, it would have supported only a single dinosaur species. For example, in one ecosystem, you might have rabbits eating shrubs, small deer eating leaves from small trees and giraffes eating the leaves from tall trees. In the same ecosystem, you might have newborn sauropods eating the shrubs, juveniles eating the leaves of small trees and adults eating leaves from the tallest trees. All of these niches would have been filled by a single species. In a similar manner, carnivorous dinosaurs from a single species but different ages might have fed on the different sizes of that sauropod.
This in turn, made the dinosaurs much more vulnerable to extinction. Suppose one type of plant disappeared from the ecosystem. Say for some reason, there were no small trees. You’d still have plenty of mammal species eating other types of plants, but with no juvenile sauropods you’d have no adults and no new babies either. This might precipitate the end of the dinosaurs from that region.
Obviously, these are oversimplifications. Still Condon and his colleagues believe this goes a long way to explain why mammals and birds survived the Cretaceous–Tertiary (K–T) extinction but dinosaurs did not.