A very interesting study published in September, 2014 in Current Biology depicts how dinosaurs made the transition to birds is a long series of changes before they were able to fly. This summary was taken from a report in the National Geographic on the web.
The first step was the development of feathers. It has been suggested that many dinosaurs developed feathers, not for flight, but for warmth. They provide excellent insolation.
The next step was to get smaller and the evidence indicates that these fauna get smaller just as other dinosaurs were getting larger. While there is no clear reason for this, I would suggest that this could be based on warmth also. If the warmth problem was solved by feathers, just as mammals used fur, dinosaurs could get smaller. Gigantism of the Mammoths and the Saber Tooth Tiger is tied to cold.
When dinosaurs became small enough to be supported by their wings in the air they were ready to conquer the air.
Why do birds fly? There is an old saying, “Nature abhors a vacuum.” This means that when there is an imbalance in nature, nature3 seeks to restore that balance.
Let us imagine a world where there is no birds. Billions of insects would exist without any predators to keep them in check. Billions of meals would go uneaten. The God of nature found a natural way to populate an important ecological niche by the creation of birds.
The new study supports the views of George G. Simpson published in 1941 that suggested that “evolutionary innovation can lead to rapid diversification among species exploiting new environmental niches.”
Opening the air as a biological niche in a new way through flight undoubtedly saved bird/dinosaurs from the extinction suffered by other dinosaurs 66 million years ago.
This important example amply proves the power of ecology and the environment to shape and guide evolution through Natural Selection.