The world’s 10,000 plus bird species are as ecologically and structurally complex as they are beautiful. The roots of all this diversity run deep, and likely began during a period of mass extinction 66 million years ago, after an asteroid struck the Earth (the same space rock that wiped out the dinosaurs).

Most of the birds that you see today come from dramatic evolutionary changes that radiated throughout the planet after the extinction of dinosaurs, says Guillermo Navalón, a paleobotanist from the University of Cambridge in the United Kingdom, in an interview with Popular Science. “And [birds] recovered really quickly, within the first 10 million years or so,” he adds.

[Related: These new interactive maps reveal the incredible global journeys of migrating birds.]

Following this mass extinction, it’s believed that distinct water and land birds evolved. According to Navalón, the understanding of this avian evolution has improved with new technology, studies are often limited to a focus on a few traits or parts of a bird’s body that are considered to be most important, like the beak or feet.

In a study published today in the journal Nature, Navalón, paleontologist Roger Benson, and their team analyzed the skeletons of more than 200 species of modern birds with 3D imaging technology and found substantial variation in their evolution. The striking differences made of evolution between water birds and land birds, for instance changes to the beak that make it easier for marine birds to catch fish, highlights the important role that the environment has on shaping features of animals.

“Birds are petite and they are relatively morphologically constant. They don’t experience crazy evolution like lizards. Most all birds have their wings and a pair of legs,” says Navalón. This consistency is important for studies like this one that used three dimensional (3D) morphology to work backwards through time to see what birds looked like.

The study analyzed 13 skeletal elements in 228 species, looking at their heads, wings, and legs. The authors find that the mass extinction played only a small role in explaining the diversity of living birds, and subsequent pulses of change and the ecology of the habitats the birds evolved in may have played a more important role.

[Related: The year’s best bird photos highlight the humor, beauty, and fragility of avian life.]

“One of the main things that really surprised us is to see such a clear pattern and a clear cut difference between animals like birds in marine environments, and birds living in terrestrial environments. We thought that ecology was not going to be as important, but apparently, it completely affected the patterns of the evolution of these animals,” says Navalón.

Since fossilized bird bones are rare, they used modern bird skeletons to work backwards through time.

“By using what we call phylogenetic comparative methods, we can interrogate the patterns just by looking at the old species, the relationships of lineages of modern species and when they split. We can tell how they split because we have genome studies that inform about the molecule evolution, and we know that this progresses in particular rates, and then we have fossils that we can calibrate the the splitting events,” says Navalón.

According to the authors, the 3D images are some of the most comprehensive to date. By building these images to travel back through time, the team’s findings reframes the discussion of how mass extinctions impact evolutionary paths. Also, it highlights the role ecology plays in bird evolution for winged creatures in the skies and the seas.