You probably didn’t know that you have a “third eye” when it comes to sleep—it’s your pineal gland. Despite its location at the exact center of your brain, it’s the only endocrine gland that has contact with the outside world. The pineal gland has cells that resemble the back of the retina.

These cells sense light through special receptors in the backs of your eyes whenever you’re exposed to light, such as the blinds opening or the TV. These cells also dictate your circadian rhythms. One way the pineal gland regulates sleep is by the production of melatonin—which is triggered by the room darkening. When you lose melatonin, you lose your normal sleep pattern.

As you age, your melatonin loses some of its potency, and the receptors for that neurotransmitter no longer create the same power from the dose of melatonin they receive. Melatonin production peaks at age five, and by the time you’re 60 you’ve lost up to 80 percent of your original melatonin levels.

Surprisingly, sleep is actually your body’s default state; you’re supposed to be asleep all the time. You fall asleep through the activation of the neurotransmitter gamma-aminobutyric acid, or GABA.

The reason you’re not asleep all the time is that your hypothalamus secretes a chemical called acetylcholine to wake you up. When you’re asleep for a long time, you experience a buildup of chemicals and the acetylcholine wins.

For the opposite effect, a chemical called adenosine builds up with activity and hinders acetylcholine, which makes you get tired. As the day goes on, your sleep drive builds as acetylcholine and other chemicals that promote wakefulness decline.

Your melatonin rises several hours before bedtime, eventually overpowering what’s left of your acetylcholine.