Falling asleep is a routine yet mystifying process. Like trying to see the 3D image in a Magic Eye poster, the more you focus on it, the less likely it is to happen. It shies away from scrutiny and is best approached with an air of detached disinterest; so, though most of us fall asleep every night, we can't say exactly how we do it.

Even neuroscientists are still struggling to understand the mechanisms the brain uses to switch from a state of wakefulness to unconscious sleep, but research reveals that the transition is a lot more gradual and tumultuous than the flip of a light switch.

According to recent work by neuroscientists at Washington University in St. Louis, during the pre-sleep stage of the process — the period when you're in bed with the lights off and your eyes closed, slowly "letting go" of the trials of the tribulations of the day — your brain waves exhibit what's known as alpha activity, typically associated with quiet wakefulness.

"It is in this period that the brain progressively disengages from the external world," Linda Larson-Prior and her colleagues wrote in a 2011 paper. "Subjects slowly oscillate between attending to external and internal thoughts, with the majority of internal thoughts being autobiographical or self-referential in nature."

Then, at some crucial moment, you enter the transitional sleep stage, known as stage 1. Brain waves slow down, shifting to a form known as theta-band activity, but are still punctuated by brief bursts of alpha activity. These hiccups give you the sense that you're still awake, said Scott Campbell, director of the Laboratory of Human Chronobiology at Weill Cornell Medical College, citing a landmark sleep study performed in the 1960s. "Investigators asked subjects aroused out of various stages of sleep whether they considered themselves asleep. Only about 10 percent of those aroused from stage 1 said that they had been asleep."

Think of what happens when you doze off while watching a movie: You remember bits and pieces of scenes for quite a while before conking out completely. Those excerpts — picked up during the short bursts of alpha-band activity in your brain — give you a sense that you're awake, though you're actually well on your way to dreamland.

Next, your brain moves on to stage 2, the start of "true" non-REM (rapid eye movement) sleep, when those bursts of alpha activity die down. All neuroscientists agree that this stage is sleep, though you still might not know it. In that same 1960s study of sleep arousal, "about 60 percent believed that they had been asleep when aroused out of stage 2," Campbell told Life's Little Mysteries. The other 40 percent would tell you they hadn't fallen asleep yet.

This makes sense in light of a 2010 study by Taiwanese neuroscientists. They demonstrated that sleep stage 2 is associated with further reductions in the perception of external stimuli. Though we're asleep, we might still hear a word or two of dialogue from that movie; it gradually fades away.

Next, we enter slow wave sleep (also known as deep sleep, delta-band activity, or stages 3 and 4), and finally, experience REM sleep — the stage when we dream. While stages 1 and 2 are difficult to perceive, 90 percent of people recognize themselves as having definitely fallen asleep when aroused after entering stages 3 or 4. That means we've completed the transition. From then on, we spend the rest of the night cycling between non-REM stages 2, 3 and 4, and REM sleep.

Sleep onset really does abhor attention. "For most people, the harder they try to fall asleep, the less success they have," Campbell said. "One dramatic example of this is Sleep Onset Insomnia. People with SOI are often so worried about the consequences of not falling asleep (i.e., exhaustion the next day), that they keep themselves awake by obsessing about falling asleep."

Of course, it's not just thinking about falling asleep that keeps us awake; obsessing about anything is likely to interfere. Campbell said, "That's why 'counting sheep,' or thinking about anything with little emotional content can help the sleep onset process."

Follow Natalie Wolchover on Twitter @nattyover. Follow Life's Little Mysteries on Twitter @llmysteries, then join us on Facebook.