Powered flight is a classic example of convergent evolution. Insects were the first land animal to take to the air but the first flight may have taken place in the water.
Sea butterflies are a small swimming predatory sea snail. These zooplankton flap their wings in the same way that insects do, albeit much slower: 4–5 wing beats per second versus hundreds for a small insect.
From a hydrodynamic standpoint, water is a viscous version of air. Sea butterflies flap in a figure-8 pattern that provides lift in the water like tiny insects do in the air. To do so, the snails rotate their bodies along with the clap and fling of wings characteristic of fruit fly flight.
The earliest vertebrates known to have powered flight were pterosaurs, a cousin to dinosaurs. Down the evolutionary line, a cousin evolved in a way that would cause a flap.
Some flightless dinosaurs lived in trees. Getting around, and quickly down to the ground, led to feathered wings. In a word: the bird.
On a completely different linage, bats are mammals whose forelimbs formed webbed wings between the fingers.
It’s shocking how incredibly soft and compliant bat wings are. The wings are geometrically complicated because they have all these joints. ~ American evolutionary biologist Sharon Swartz
Whereas birds flap their entire forelimbs, bats flap their fingers, which are long and covered by a thin skin (patagium) or membrane. Yet, due to biomechanical constraints and the evolutionary vector of limb modification, the wings of birds and bats are similar in construction.
Pterosaurs had yet a different flight path to the same effect. Their wings evolved from a greatly lengthened 4th of 4 digits, with an arm membrane (brachiopatigium) extending from the 4th finger to the body, creating a wing. The other digits were part of the wing in some pterosaur species. Many pterosaurs, if not all, also had webbed feet.
Powered flight evolved independently in pterosaurs, birds, and bats, each of which has a different configuration of the bony elements and epidermal structures that form the wings. ~ Chinese vertebrate paleontologist Min Wang
Convergence toward gigantism and flightlessness was facilitated by early Tertiary expansion into the diurnal herbivory niche after the extinction of the dinosaurs. ~ Australian evolutionary biologist Kieren Mitchell
Sometimes flight becomes an unnecessary extravagance, even if you are a bird. All the flightless birds are lumped together as ratites. Ratites tend to be sizable birds. Several are fast runners, as befitting being large and living on a savanna. The ostrich can outrun a horse.
It’s relatively easy to lose flight. ~ American evolutionary biologist Scott Edwards
Flightlessness convergently evolved at least 5 times, consistently doing so through delicate changes in regulatory genes focused on limb development. More disruptive mutations were done to facilitate optimal metabolism for the fleet-but-flightless lifestyle.
In that it overcomes a stronger gravitational force by occurring in air, flight is the fancy version of swimming. Unsurprisingly, selfsame biomechanics of swimming through viscous media convergently evolved innumerable times.
Undulatory locomotion, a gait in which thrust is produced in the opposite direction of a traveling wave of body bending, is a common mode of propulsion used by animals in fluids, on land, and even within sand. ~ American biomechanics physicist Daniel Goldman et al