How do birds avoid mid-air collision?
They can't see all the birds that are around them as some are hidden behind the others. However, I don't think there is anything so extraordinary; they watch around, have good reflexes and can change direction very abruptly. There is no need for some kind of special sensing abilities to explain bird flocks. 

3 simple rules

One can simulate a flock of birds with 3 simples rules:


Adapt your speed on the speed of the other agents


$$\overrightarrow v_{i,1} = \frac{1}{K_L}\sum_j^K\overrightarrow v_j (t) - \overrightarrow v_i(t)$$

, where $K_L$ is the number of birds in the Large area of perception, $\overrightarrow v_j (t)$ is the speed of a given bird in the large area of perception and $\overrightarrow v_i (t)$ is the speed of the focal individual.


Attraction


$$\overrightarrow v_{i,2} = \frac{1}{K_L}\sum_j^K\overrightarrow p_j (t) - \overrightarrow p_i(t)$$

, where $\overrightarrow p_i(t)$ and $\overrightarrow p_j(t)$ are the positions of the focal bird and of a bird present in the large area of perceptio, respectively.


Repulsion


$$\overrightarrow v_{i,3} = -\frac{1}{K_s}\sum_j^K\overrightarrow p_j (t) - \overrightarrow p_i(t)$$

, where $K_s$ is the number of birds present in the Small area of perception.

Then, to update the speed of the birds you just sum up those 3 contributions: 

$$\overrightarrow v_i(t+1) =  \overrightarrow v_i(t) + \overrightarrow v_{i,1} + \overrightarrow v_{i,2} + \overrightarrow v_{i,3}$$

see boids for more information.

My point in descrbing this algorithm is that you can get the emergent behaviour of a bird flock out of very simple rules.

Bird Collision

If birds don't often collide each others (what I assume but honestly I don't know much), note that it is estimated that 100 millions birds that die every year after colliding a window (see here). Birds also collide with power lines (ref) and wind turbines (ref).