You’re just about to board the plane when you hear an announcement at your gate: All carry-on bags now need to be checked. This can be a huge relief (less weight to lug around!), but it can also be a hassle when you’re waiting around at baggage claim and wondering whether your luggage is lost somewhere far away.

The reason airlines sometimes make you check your bags at the last minute might not be what you’re expecting, though. According to Vox, it has less to do with the amount of available space in the overhead bins and more to do with the time that’s being wasted by waiting for fliers to secure their carry-on bags. Aviation economics expert Samuel Engel told Vox that airlines lose money for every minute that the plane isn’t flying. He said carry-on bags are the biggest holdup when it comes to boarding delays, so there's a lot of incentive to speed up the process. “You have this $35 million asset you want to make sure you’re flying 10 or 11 hours of the day,” he said.

A gate agent at Dallas Fort Worth's airport also told Vox that the staff has just 20 minutes to shepherd passengers onto the plane, and if they take any longer than that, they’re held responsible and could lose their jobs.

Sometimes, though, the mandatory baggage check is related to space. Gate agents often keep track of the number of passengers who board with carry-on bags that are too large to fit underneath their seats. Planes don’t have enough overhead bin space to allow every passenger to bring a carry-on bag, so there has to be a cut-off at some point.

To make sure you'll have everything you'll need while traveling, try to pack essential items (like medications and your toothbrush) in your personal item bag instead of a carry-on. You wouldn’t want to lose your carry-on and not have a single pair of clean underwear to change into.

[h/t Vox]