If several pigeons join together, one is always watching for dangers. A hawk can be discovered any second! The lookout quickly flies off and the rest follows immediately. Pigeons profit from sticking together.
Thus, pigeons in a flock are more likely to survive. Among groups of wood pigeons, the birds who live in flock become more prevalent over time than those who live on their own.
If the habit of forming flocks is a hereditary characteristic, it is passed on to the chicks. Therefore, after many generations most pigeons will have this characteristic. This probably occurred in previous generations as well. This is why we often find wood pigeons forming flocks today.
The hawk kills solitary pigeons. Thus, it makes a selection that after several generations makes the wood pigeons better at escaping the hawk.