When an airplane’s cabin lights dim, well-conditioned air travelers instinctively know their flight has been cleared for takeoff, or that they are in the final moments of descent before a plane touches down. And though the lowering of cabin lights is widely accepted as a safety procedure, what purpose does it actually serve?

“You want your eyes acclimated,” says Jon Lewis, a senior pilot with a major U.S. airline. “During nighttime takeoffs and landings, you dim the lights so that you have some night vision going on.” Dimming cabin lights during the day, then, is less necessary, but does conserve some engine power as the plane hurtles toward flight. (Less taxation on the engine means an aircraft can shorten its takeoff roll, or when a plane is aligned with a runway centerline and will soon become airborne.)

Airplane power aside, the primary reason for a change in cabin lights is directly connected to why crewmembers ask passengers to raise their shades: safety in case of an emergency. It can take our eyes between ten and 30 minutes to fully adjust to a dark setting, reports The Telegraph, which means that dimming the lights can help eyes pre-adjust to lower light. And if it’s night when everyone must suddenly evacuate, those several seconds it takes for your eyes to calibrate to low-light conditions are precious, and can make all the difference in safely exiting the aircraft. In dimmer light, emergency lighting and illuminated pathways will be more visible, too.

Along the same lines, having the shades up gives everyone more awareness of their surroundings, and offers flight attendants a view outside in case of an equipment abnormality or hazards—think debris or fires that may affect an evacuation. And many passengers are more comfortable during takeoff and landing—the two most dangerous parts of the journey—if they can see outside, and note their orientation to the ground. By allowing natural light to flood into the cabin, a sudden exit into the sunny outdoors is less disorienting for passengers and crew alike, and evacuees, the thinking goes, will be better able to move away from the plane.

Lewis says pilots do the same thing in the cockpit, so that their eyes are acclimated to outside conditions. In fact, in a lightning storm, he will raise the cockpit lights to high. “That way, if you get a big lightning flash, you aren’t flash-blinded,” he says. “What you are trying to do is utilize the outside cues.”

Every airline has its own set of procedures, however, so the exact situations that warrant a raising or lowering of the cabin lights may vary between carriers. Moral of the story? Wait to put your sleep mask on until after the plane has reached its cruising altitude.