I've seen videos of hundreds of birds flying in the same general direction but creating incredible patterns in the sky seemingly instantaneously! How do they all know in what direction to turn at the same time? Is there a "Lead" bird dictating this somehow?
Richard Dawkins discusses this in his book The Greatest Show on Earth: The Evidence for Evolution.
The birds, in the aforementioned example Starlings, 'know' which direction to fly and where to be by obeying simple local rules concerning the distance and spacing of other members of the flock in their immediate vicinity, without any global knowledge of the size or shape of the flock in its entirety.
The key to this behavior is that there is no choreographer and no leader. Order, organization and structure all emerge as by-products of rules obeyed locally, many times over.
Dawkins equates this to 'bottom-up' design or 'self-assembly'. This is also how embryology works. Beautifully 'designed' bodies emerge as a result of single cells obeying local rules. The idea of a blueprint is a misconception.
Dawkins mentions a man in the book named Craig Reynolds who wrote a program in 1986 called 'Boids' which models the flocking behavior of thousands of birds - http://en.wikipedia.org/wiki/Boids