My theory is that this is an instinctual behavior that helps protect them from aerial predators. They fly in close formation, switching directions instantly and en masse, without following any obvious leader.