The evolutionary history of insects, like that of many other invertebrate groups, is poorly understood. For many decades, it was thought that they branched off of millipedes and centipedes, which are known to have colonized the land as early as 428 million years ago, during the Silurian period. But recent genetic studies suggest that insects more likely split off from crustaceans sometime around 410 million years ago. The circumstances of this evolutionary change are subject to debate, and much less clear than the evolution of lobe-finned fish into primitive tetrapods.
The earliest known specimen in the history of insects is the Devonian fossil Rhyniognatha hirsti, dated to between 396 and 407 million years ago. It was found in the Rhynie Chert formation, a well-preserved Devonian ecosystem which includes some of the first land plants with vascular tissues and among the earliest and best preserved fossils of terrestrial arthropods. The mandibles of this insect suggest that it had already developed flight, shrouding the origins of insect flight and other important aspects of the history of insects in mystery.
Exactly when and how flight entered into the history of insects is poorly understood. One researcher, Jim Marden, has presented a model where insect flight evolved from evolutionarily adaptive intermediate steps involving skimming on water. He points to stoneflies, a living insect group that uses its wings to skim along the surface of water. Species have been found employing varieties of water skimming that feature less and less actual contact with the water, each step providing substantial benefits in terms of speed and thereby ability to avoid predators and seek out food sources.
There are several known groups of hexapods (six-legged invertebrates) which are evolutionarily basal to insects and would have split off from them prior to about 400 million years ago, when the first fossil insects appear. These include the abundant springtails as well as the less recognized proturans and diplurans. It is thought that springtails, proturans, and diplurans all evolved their hexapod form of locomotion independently of one another, but only insects gained the ability to fly.
For tens of millions of years, insects and other small invertebrates were the only animals to colonize the land, at the time covered by short plants no taller than waist height. As plants grew and a lineage of fish evolved into the first amphibians, insects were joined by larger tetrapods, which would have consumed them in great numbers to survive. However, thanks to the high oxygen levels of the Carboniferous period, about 320 million years ago, some insects grew to huge sizes, such as the griffinfly Meganeura, which had a two foot wingspan. But when oxygen levels went down, these insects promptly died due to an inability to circulate sufficient oxygen through their bodies.
The next major milestones in the history of insects occurred throughout the Mesozoic, when most modern groups as we know them evolved. Around 120 million years ago, flowering plants evolved, and the cooperation between insects (especially bees) and these newcomers led to a mutually beneficial evolutionary relationship. As a result, flowering plants are now the dominant terrestrial flora.