It protects against predators: together, the birds can constantly watch out for perils. All individuals switch between eating and keeping watch.
All individuals profit from living in flock, yet high-ranking birds always profit more than low-ranking. The high-ranking birds have precedence to secure food locations, while low-ranking ones are left to exposed positions where predators are more likely to strike.