In a study on barn owls, neuroscientists at Stanford University in California found that neurons in the midbrain, which acts as a relay for sensory information, engage in a 'winner takes all' battle with one another.
And the victors decide the owl's gaze and attention.
The findings could explain how the brain decides where to look in an emergency.
The senses detect everything around them, but the brain can only focus on one part of the world at a time, which is usually decided by the conscious mind.
But when confronted with a loud noise or fast-moving object, the urge to look becomes automatic.
That response makes sense, says principal investigator Eric Knudsen.
"When there are features in the environment signalling something that could be life-or-death, we'd want to know about it," Nature quoted him as saying.
And to know how this head-turning decision happens on a cellular level, the researchers used barn owls, which have neatly arranged midbrains that are easy to study.
The study focused on a circuit in the midbrain known as the isthmotectal network, which receives sensory information and tells the eyes where to look.
And they observed that neurons in the isthmotectal network engage in a constant battle to decide which ones are sensing the most important stimulus.
Usually nothing in the environment will be arresting enough to trigger the system, but when something does come along - a flash of light, a shotgun's crack - the responding neurons will switch on, sending a strong signal that usurps the animal's attention.
The study was presented at the annual meeting of the Society for Neuroscience in Chicago, Illinois.