320 million years ago, during the Carboniferous Period, the flora and fauna looked quite different than it does today. Oxygen levels in the atmosphere were much higher, allowing insects to grow to enormous sizes. Centipedes were the size of snowboards; dragonflies were the size of hawks; and spiders were the size of dinner plates. There were also no mammals. Not only that, but there were no reptiles, no dinosaurs, and no birds (which, of course, are dinosaurs). There were, however, amphibians. Amphibians, like frogs and salamanders, cannot lay their eggs on dry land, and instead must lay them in pools of water. This is because the eggs that they lay, unlike those laid by dinosaurs, birds, reptiles, and monotremes (the two egg-laying mammals), have soft-shelled eggs, which allows water to move in and out of them. They would simply dry up on land!
Around 320 MYA, however,
something changed. Some of these amphibians developed what is known as
an "amniotic egg," the type of egg typified by the dinosaurs, birds,
reptiles and monotremes.
Around 5 million years after
that, around 315 MYA, another major split occurred, this time between
the amniotes. This split resulted in two lineages, the first of which,
the synapsids, would one day become the mammals. The second of these
two lineages was the sauropsids. Within the sauropsids was the group
known as the archosaurs. The archosaurs, in turn, suffered two major
splits. The first split was the crocodiles, alligators and their kin.
They joined with the rest of the reptiles contained within the
sauropsids. The second large split within the archosaurs was another
large group, off of which the pterosaurs broke off, before the rest of
the group became dinosaurs (and, in turn, birds). If you look at the
family tree below, you can see that the group known collectively as the
"reptiles" is what is referred to as a "paraphyletic group." Put
simply, that means that a paraphyletic group consists of "all the descendants of the last common ancestor of the group's members minus a small number of monophyletic
groups of descendants, typically just one or two such groups." So for
reptiles, that means that the group consists of the last common ancestor
of all reptiles (which includes both extant reptiles and the extinct
mammal-like reptiles, the precursors of the mammals), including all of
the descendants of that ancestor....EXCEPT for the mammals and the
birds, which are defined separately. I feel like I have confused you enough, so I am not even going to get into the whole dinosaur debate.