When you complain about dead bugs on your windshield, be thankful that insects today are considerably smaller than their prehistoric ancestors.

Hundreds of millions of years ago, giant insects were common on Earth. Consider Meganeura, a genus of extinct insects from approximately 300 million years ago, related to modern-day dragonflies. One member of this group – M. permiana – was first described by researchers in Kansas in 1937 as having a wingspan of over 2 feet (0.6 meters). It’s still considered one of the largest known insects that ever lived.

While over a million insect species live today, truly giant insects no longer exist. Why did they disappear?

There are two main reasons. The most important is that our atmosphere has changed. Millions of years go, the air surrounding our planet was warmer, moister and contained more oxygen. During the Carboniferous and Permian periods, Earth’s air contained 31-35 percent oxygen, as compared to just 21 percent oxygen in the air today.

Oxygen levels are especially important for insects because they don’t have lungs. Instead, they rely on air flowing through a series of opening across their bodies called spiracles, which connect directly to the tissues that need oxygen.

But there’s another reason giant insects disappeared. As ancient dinosaurs evolved the ability to fly, eventually becoming modern birds, they put a cap on insect size through predation and competition.

The earliest known bird – Archaeopteryx – appeared about 150 million years ago. Birds proved to be faster and more agile than the giant insects. In an article in LiveScience, paleobiologist Matthew Clapham of UC Santa Cruz commented:

The change in insect size is gradual. This gradual change fits quite nicely with the gradual evolution in birds at the time.

Read more: Ancient insect graveyards reveal an explosion in bug diversity 237 million years ago

Bottom line: Hundreds of millions of years ago, giant insects were common on Earth. The decline in atmospheric oxygen and the rise of birds contributed to their demise.