Two possible rules
Imagine a bird in a flock reacting to the others. One rule is based on distance: respond to every bird within a set radius. Another rule is based on count: respond to the nearest few birds, however far away they are. Scientists call these metric and topological interaction.
Which one real birds use is something you can only tell by measuring where each bird is.
What the measurements showed
Ballerini and colleagues reconstructed the three-dimensional positions of individual birds in airborne flocks of a few thousand members. They found that each bird interacted with a fixed number of neighbours, about six or seven, rather than with all the neighbours within a fixed distance.
The authors write about six or seven, so a single number such as seven is shorthand.
Why a count might help
The authors argue that a topological rule is needed to keep a flock cohesive when its density changes a lot because of outside disturbances, typically predation. Their simulations support this: the count rule gave higher cohesion than a distance rule.
This is a result from one field study plus models, not a proof that every flock works this way.

