If there is one persistent gripe that paleontologists have with dinosaurs
Take a look at your own hands for a moment. Stick one out in front of you so that your palm is oriented straight up-and-down. Now imagine that you could bend your wrist so much on the "pinky" side that your fingers would be pointing straight backwards towards your elbow. That is what birds can do, and it is important to the way they fly and fold up their wings when on the ground.
As with many other "bird" characteristics, though, this feature evolved first among dinosaurs, and it probably had its beginnings in something that did not have anything at all to do with flight. As outlined by paleontologists Corwin Sullivan, David Hone, Xing Xu and Fucheng Zhang in their new study, the evolution of a peculiar wrist bone in theropod dinosaurs called the semi-lunate carpal allowed the wrists of predatory dinosaurs to become more flexible. This may have had something to do with hunting, but regardless of the reason why it evolved, it set the stage for the evolution of increased wrist flexibility among the ancestors of birds.
Maniraptoran dinosaurs were a diverse group, containing an array of feathered dinosaurs from the weird therizinosaurs to the famous "raptors" and birds, and as this group evolved many lineages were adapted to have greater wrist flexibility. This can be seen in their anatomy: the degree of asymmetry in the wrist bones provides an indication of how far the wrist could be flexed. Not surprisingly, the feathered dinosaurs most closely related to birds show the greatest amount of flexibility, but why were their wrists adapted in this way?
Nobody knows for sure. It had originally been proposed that this flexibility could be attributed to hunting, but the same changes are seen in maniraptorans that were herbivores and omnivores so it is unlikely that hunting provides the answer. Instead, the authors of the new study propose, the ability to fold the hands backwards would have protected the feathers of the arms. This would have prevented the feathers from getting damaged or from being in the way as the dinosaurs moved about, although the authors recognize that this hypothesis requires further evidence.
Perhaps more significant, however, is how this wing-folding mechanism may have allowed birds to take to the air. Birds do flex their wrists while flapping their wings to fly, and so it appears that the wrist flexibility that first evolved in dinosaurs was later co-opted for flight in birds. This is what is known as "exaptation," or when a previous adaptation takes on a new function. Indeed, as more is discovered about the evolution of birds, the more traits paleontologists find that evolved for one function but have been co-opted for another at a later point (feathers themselves being the most prominent example). There is relatively little separating birds from their feathered dinosaur ancestors.
For more on this new study see Not Exactly Rocket Science and Dave Hone's Archosaur Musings.
Corwin Sullivan, David W. E. Hone, Xing Xu and Fucheng Zhang (2010). The asymmetry of the carpal joint and the evolution of wing folding in maniraptoran theropod dinosaurs. Proceedings of the Royal Society B : 10.1098/rspb.2009.2281