The birds precisely time the flapping of their wings and adjust their position to make the best of the subtle effects of air turbulence, researchers discovered.
In this way, each bird takes advantage of "upwash" thrown up by the wings of the flyer in front while avoiding lift-sapping "downwash".
How birds monitor and react to such complex flight dynamics without the aid of a computer remains a mystery.
Scientists learned the aviation secrets of migrating birds after attaching tiny logging devices to a flock of 14 northern bald ibeses that not only tracked their position and speed by satellite but measured every flap of their wings.
The birds were studied as they flew alongside a microlight on their migration route from Austria to their winter home in Tuscany, Italy.
Lead researcher Dr Steve Portugal, from the Royal Veterinary College, University of London, said: "The distinctive V-formation of bird flocks has long intrigued researchers and continues to attract both scientific and popular attention, however a definitive account of the aerodynamic implications of these formations has remained elusive until now.
"The intricate mechanisms involved in V-formation flight indicate remarkable awareness and ability of birds to respond to the wingpath of nearby flock-mates. Birds in V-formation seem to have developed complex phasing strategies to cope with the dynamic wakes produced by flapping wings."
The V formation commonly adopted by migrating birds has long been thought to help them fly more efficiently, staying aloft while expending as little energy as possible.
Allied bomber pilots in the Second World War are rumoured to have noticed their fuel economy increase when they flew in a V formation.
This apocryphal story has never been verified, but the energy-saving benefits of formation flying are well known to both civil and military pilots.
By maintaining one wing tip in the wake of a forward aircraft, a fighter jet can reduce its energy consumption by up to 18%, according to an article cited in the journal Nature, where the new research is published.
Taking advantage of formation flight is much more difficult for birds with flapping wings.
When flying in a V formation, the birds' wing flaps were approximately "in-phase", meaning all the wing tips followed roughly the same path, the scientists found. This helped each bird capture extra lift from the upwash of its neighbour in front.
Occasional shifts of position within the formation meant that at times birds flew directly one behind the other. When this happened, the birds altered their wing beats to an out-of-phase pattern to avoid being caught by downwash.
The 14 birds used in the study were hand-reared at Vienna Zoo in Austria by the Waldrappteam, an Austrian conservation group that is re-introducing northern bald ibeses to Europe.
The birds were trained to follow a microlight to teach them their historic migration routes to wintering grounds in Italy.
They will be left to find their own way back to their breeding grounds in Salzburg later this year without the help of the microlight.
Professor David Delpy, chief executive of the Engineering and Physical Sciences Research Council which funded the study, said: "This is a fascinating piece of research, providing a scientific answer to a question that I suspect most people have asked themselves - why do birds fly in formation? The results will prove useful in a variety of fields, for example aerodynamics and manufacturing."