A new study which partly drew on New Zealand's fossil record has shown how the massive asteroid that wiped out the dinosaurs also obliterated Earth's forests - and the birds that were living in them.
The Cretaceous–Paleogene (K–Pg) extinction event occurred 66 million years ago, when an asteroid crashed into the planet with a force a million times larger than the world's biggest atomic bomb.
The cataclysm is today associated with a geological signature called the K–Pg boundary, which still preserved across the world, including in New Zealand.
A team of US and UK authors took a fresh look at the event, focusing on what it meant for plants and the animals that depended on them.
"Looking at the fossil record, at plants and birds, there are multiple lines of evidence suggesting that the forest canopies collapsed," said Regan Dunn, a palaeontologist at the Field Museum in Chicago.
The study authors pulled together a range of evidence to stitch the story together.
"We concluded that the temporary elimination of forests in the aftermath of the asteroid impact explains why arboreal birds failed to survive across this extinction event," said Daniel Field, the paper's lead author, of the Milner Centre for Evolution at the University of Bath.
"The ancestors of modern arboreal birds did not move into the trees until forests had recovered from the extinction-causing asteroid."
Pollen analysis helped determine that the world's forests were destroyed by looking at microscopic fossils of pollen and spores.
"After a disaster like a forest fire or a volcanic eruption, the first plants to come back are the fastest colonisers - especially ferns," Dunn explained.
That was because ferns don't sprout from seeds, but from spores, which were much smaller - just a single cell.
"Spores are minuscule, the size of a grain of pollen, so they're easily dispersed.
"They get picked up by the wind and go further than seeds can, and all they need to grow is a wet spot."
To view the spores, scientists took a sample of rock from the time frame just after the collision and dissolved it in acid.
They then purified it, so that all that remained was the organic debris, like pollen and spores, which could be more closely inspected under a microscope.
Immediately after the asteroid hit, the fossil record showed the charcoal remains of burnt trees, and then, tonnes of fern spores.
An abundance of fern spores in the fossil record often comes on the heels of a natural disaster that destroyed larger plants like trees.
Examining the fossil record from New Zealand, as well as Japan, Europe and North America, showed there was a mass deforestation across the globe at the end of the Cretaceous period.
And with no more trees, the scientists found, tree-dwelling birds went extinct.
The birds that did survive were ground-dwellers - birds whose fossilised remained show longer, sturdier legs like we see in modern ground birds like kiwi and emus.
The Cretaceous equivalent of robins and sparrows, with delicate little legs made for perching on tree branches, had no place to live.
"Today, birds are the most diverse and globally widespread group of terrestrial vertebrate animals - there are nearly 11,000 living species," Field said.
"Only a handful of ancestral bird lineages succeeded in surviving the mass extinction event 66 million years ago, and all of today's amazing living bird diversity can be traced to these ancient survivors."
The early ancestor of today's tuatara also survived the event, as did a distant cousin that became extinct a few million years later.
While fossil animals like dinosaurs and birds often get more love than fossil plants, Dunn said that plants are critical to understanding life on Earth.
"Plants are everything, plants are the context in which all terrestrial life evolves and survives.
"They're primary producers, they make energy available to all life forms by capturing it from the sun - we can't do that."
She also noted that while the dinosaurs and their perching bird neighbours died 66 million years ago, their plight was just as relevant today.
"The end-Cretaceous event is the fifth mass extinction - we're in the sixth," Dunn said.
"It's important for us to understand what happens when you destroy an ecosystem, like with deforestation and climate change - so we can know how our actions will affect what comes after us."