I remember seeing a video from the 80s about how the behavior is emergent - they made a computer program that replicated how birds fly by stating just a few axioms like don't fall behind and don't be in front.
The idea being that the V takes shape because they want to have a bird in front of them the entire time while one poor bird gets stuck out in front.