Exactly what your flickering eyes are doing during the rapid-eye-movement phase of sleep has long been a mystery to scientists, but a team that monitored the neurons of volunteers says it has figured it out.

The neuroscientists say that brain activity during eye flickers in REM sleep is "very, very similar" to when people see a new image when awake, strongly suggesting that the eye movements are linked to a "change of scene" during a dream, the BBC reports.

The researchers, whose study is published in the journal Nature, worked with sleeping volunteers with epilepsy who had electrodes implanted into their brains, reports New Scientist.

Lead researcher Dr Yuval Nir tells the BBC that the region of the brain where most of the electrodes were located—the medial temporal lobe—and where the activity was observed deals not with vision so much as mental imagery.

That may explain why rapid eye movements have been observed in fetuses and people who are blind. As for the activity that researchers saw, it peaked roughly a quarter of a second after the eye flicker, much like during wakefulness.

That leads Nir to say he's "sure that the brain is alternating between different mental imagery. Every time you move your eyes, a new image forms in the mind’s eye." But one British neuroscientist tells the BBC that while one question may have been answered, a larger one looms: "The most fascinating question of all is why do we have to have REM sleep? Why does our brain have all this circuitry to do that? This paper doesn't answer that." (REM sleep has also been linked to religious experiences.)

This article originally appeared on Newser: Scientists Unlock a Mystery of REM Sleep

More From Newser