So how does an airfoil work, you wonder?
Well, it's all about the shape. The convex top and flat or concave bottom cause the air flowing over the top to travel faster than the air moving across the bottom. The theories behind this are complicated, but the most widely accepted is that the flow streams (indicated by black arrows) are compressed, forcing the air to move faster. An alternate and frequently cited idea is that the air must rejoin the air it split from at the rear of the wing, but this has been disproven. Apparently the air moves even faster over the top than predicted by this theory, and usually beats the air from the bottom.
Whatever the reason, the important part is that this happens. The air flowing over the top of the wing moves faster than the air flowing underneath it. This causes the pressure to decrease on the top of the wing. This pressure differential generates lift.
What does this have to do with evolution?
Birds wings are airfoils, too. Interestingly, each feather is also an airfoil. This is because the feathers are asymmetrical; quills on the forward-facing side of the vane are shorter than those in the rear side. However, early bird-ancestors that have been discovered have symmetrical feathers. This means the quills are the same length on either side of the vein.
Symmetrical feathers are useless for flight. These lack the airfoil shape that is necessary to generate lift and fly. A feathered dinosaur with symmetrical feathers may be able to glide, but will never truly fly.
Because of this, it is clear that the feather did not originally evolve for flight, but more likely for warmth and/or communication. It was then adapted from its original purpose, eventually becoming the airfoil shape we see on extant birds today.