Thanksgiving is almost upon us, which means we’re in the middle of the busiest—and, if you include the holiday itself, least busy—travel days of the year. Nearly 25 million people are projected to fly on U.S. airlines during the 12-day period between Nov. 21 and Dec. 2.

Some of these passengers booked their flights months in advance, snagging the lowest fares; those who purchased tickets in the past few weeks typically paid much, much more; a rare few lucked out with last-minute deals. Three people sitting side-by-side in the same coach cabin seats most likely paid dramatically different fares.

It is not surprising that, with such a large number of people wanting to travel on very specific days, the airlines charge a premium for these limited seats. But one of passengers’ biggest frustrations with air travel is the complex, cryptic, and seemingly unfair pricing systems, which create a high variability in what different customers pay for the same service. Why can’t the airlines just charge one single, simple fare for each flight and treat everyone on that flight the same? Wouldn’t we all be better off?

Probably not.

The airlines, being for-profit companies, set prices to maximize revenue. But at least to some degree, their pricing systems can work to passengers’ advantage as well—even to those who end up paying the highest fares.

How could that be? Consider the following simplified example.

Suppose that an airline offers a 100-seat flight from Philadelphia to Chicago, and that it costs $40,000 to cover the costs of the airplane, fuel, pilots, flight attendants, landing fees, insurance, and so on. The airline needs to make at least $40,000 in ticket revenues for the flight to be worth flying. If the airline were to offer just one fare for all tickets on that flight, what should that fare be?

Selling every seat for $425, for a total of $42,500, would make the flight nominally profitable.

But there may not be 100 people willing to pay $425 for this flight. Maybe there are 100 cash-poor college students who want to fly, but can only afford $300 per ticket. On the other hand, there may be 20 business travelers who want to fly, each willing to pay up to $900.

If the airline charges $425 per ticket, they’ll only sell 20 of them, earning $8,500 and flying at a loss. They could raise the fare to $900 and still sell to those same 20 business travelers, but at $18,000 the flight would still be a money-loser.

To capture more people at a single fare, they’d have to charge $300. Then they’d sell all 100 seats, but only earn $30,000 in revenue. Still a money-loser.

This is where “fare differentiation” comes in. If they can sell $300 seats to 80 college students and $900 seats to 20 business travelers, then they can sell all 100 seats, earning $42,000 and making the flight worth offering.

Of course, the airlines can’t ask you “How much are you willing to pay? Are you going on Spring Break, or flying to close a major deal?” Instead, they differentiate through things like advance purchase, Saturday stay-overs, and limited numbers of seats at lower fares. In other words, you actually are buying different things: the college students may have to pick a less convenient time or date to get the lower fare, and have to finalize their plans far in advance. In contrast, business people are paying for the right to make last-minute plans, and the seats set aside at higher fares act as a capacity reservation—the flight is less likely to be sold out two or three days in advance because some of the seats are kept “on reserve” for only those who highly value the ability to fly at that exact time, and are willing to pay accordingly.

While it is definitely to the benefit of college students to have business travelers “subsidize” their fares, the business travelers may be getting the bigger benefit—and not just because there are usually a few tickets still available at the last minute (at the highest fare). This fee structure allows airlines to increase the number of flights offered, giving the business traveler more options to choose from. For example, the college student who would prefer to travel on Sunday afternoon, but can’t afford it, instead books a cheaper flight for the crack of dawn on Monday. As a result, the business traveler who needs to make a Monday meeting in another city, but who still wants to spend Sunday night with her family, is able to do so.  Without the demand (and revenue) from the college students, the airlines might not find it worth offering that early morning flight.

It is no surprise that commercial airlines invest heavily in “revenue management,” trying to figure out the pricing scheme that maximizes their profits. But if this practice ensures that there are seats available for everyone to get where they need to go, then maybe that’s something to be thankful for.