Airlines know that not every passenger will show up for the flight. One gets stuck in traffic and misses the plane. Another catches the flu or has a hangover. Another has cold feet about her wedding in Cancun. Whatever the reason, airlines want to ensure that as few seats as possible fly empty, so they sell more seats than the plane’s capacity.

Of course, sometimes too many passengers show up to check in. About 50,000 passengers were bumped from flights involuntarily by US airlines last year, according to the Department of Transportation, but about 10 times as many passengers take the bump voluntarily, answering the gate agent’s call for “a few volunteers” in exchange for freebies.

As the TED-Ed video explains, bumping passengers (voluntarily or involuntarily) comes with a cost—putting bumped passengers up in hotels, rebooking them, giving them upgrades or compensation, or angering them so much that they fly with another airline next time.

So airlines need to walk a fine line, making a shrewd assessment of the economic risks of overbooking vs. underbooking. To do this, they parse many years of data on how many passengers show up for certain routes on certain dates, the video explains. Often they get the number right, no one is bumped, and the airline maximizes its profits.

But if you’re one of the unlucky ones that bumped this holiday season, that’s a cold comfort.

📬 Sign up for the Daily Brief

Our free, fast, and fun briefing on the global economy, delivered every weekday morning.