I suppose you could compare birds flying in a flock to people running a marathon. Collisions in a marathon rarely occur, as people tend to know who and what is around them. Birds have a very keen sense of 'flock mentality'. One bird in a flock will closely monitor the movements of the six or seven birds close to it. Those birds will monitor the six or seven closest to it, so on and so forth. This behaviour allows the birds to fly together, and because the birds monitor the others' movements so carefully, this means flock collisions rarely occur as the birds are always watching each others positions.
However, despite their uncanny ability to fly in sync, collisions can occasionally occur, just as marathon runners can sometimes collide.