Flocking is the behavior exhibited when a group of birds, called a flock, are foraging or in flight. Sheep and goats also exhibit flocking behavior. Flocking by birds and mammals is similar to schooling in fish and these are often studied together.
Flocking is generally believed to arise from the need for cover and protection from predators in animal behavior. This is an emergent behaviour governed by local rules that are followed by individuals and does not involve any central coordination.