Starlings congregate in communal roosts throughout the winter, numbering from a few thousand to over a million birds. The leading hypothesis for why they gather in such huge numbers is that it is an anti-predator strategy.
By diluting the risk as the group size increases, the chance of any one individual suffering predation decreases and many eyes means that vigilance increases with the number of individuals.
Most aerial predators (sparrowhawk, peregrine falcon for example) hunt by targeting a single bird. The confusion caused by the constant movement may hinder their ability to lock onto an individual.
[Birds of a feather flock together: Insights into starling murmuration behaviour revealed using citizen science - A. Goodenough et al 2017. PLOS ONE]
Read more about my work on starling murmurations in my latest photo essay.