There's a reason sleeping in an unfamiliar bed often means not sleeping at all — and it's not because you're busy reenacting a Boyz II Men video.

This phenomenon is called the "first-night effect," and it's when only half your brain goes into rest mode in an unfamiliar setting, according to a study published on Thursday, NPR reported. To find out why this is, researchers studied the brain scans of 35 Brown University students who hit the hay in the unfamiliar surroundings of a sleep lab.

The brain scans showed patterns of slow-wave activity, which is associated with deep sleep, in the right side of the brain, as if the left were staying awake to be on guard. The left side is better connected than the right to certain parts of the brain, which could be helpful for "faster responses to risk factors," according to the study.

"When we're sleeping in a new environment and we don't know how many predators are around, it would make sense to keep half the brain more alert and more responsive to bumps in the night," Niels Rattenborg, leader of the avian sleep group at Germany's Max Planck Institute for Ornithology, said, according to NPR.

This disparity in slow-wave activity dissipated after the first night.

The researchers also performed two experiments with the students: The first was playing a "deviant sound" — what NPR described as "a repeated standard tone followed by a single tone of a different pitch" — to see where the subjects' brains responded, and the second was seeing if playing a sound into either the right or left ear would awaken the students faster. With both experiments, the left side of the brain won, waking up the subjects and responding to the stimuli.

The "first-night effect" is actually something that animals such as birds and dolphins can already do, according to NPR. This is usually a survival tactic so the animal can be aware of any nearing predators.

The brain response is automatic and something that just came with human development, NPR reported, although sleepovers aren't exactly the same as the dangerous wild.