The Triassic (252–201 Ma) opened on a recovering, mostly empty world — a single supercontinent, Pangaea, hot and dry. Into that gap stepped the archosaurs, the reptile group that includes dinosaurs, pterosaurs, and crocodilians, gradually displacing the mammal-like reptiles that had ruled before. The first true dinosaurs appear around 230 million years ago — small, bipedal creatures like Eoraptor and Herrerasaurus — but for tens of millions of years they were a minor presence among many archosaur lineages.
What set them up to win was a package of advantages: an upright, energy-efficient posture (legs tucked under the body, not splayed to the sides), probable warm-bloodedness, and unusually fast growth. Then came the second stroke of luck. At the end of the Triassic (~201 Ma), as Pangaea began to crack open, massive volcanic eruptions triggered another mass extinction that erased nearly all the dinosaurs' archosaur competitors.
The field was clear. In the Jurassic that followed, the dinosaurs exploded into the dominant land animals on Earth — a reign that would last 165 million years.