It happens all the time. On a business class flight to London you feel like a sucker when you find out that the traveler next to you paid a thousand dollars less for the same ticket.

This is called dynamic pricing, and airlines love it. The mechanics behind it are somewhat complicated, but what it boils down to is this: by selling flights at the highest price the customer is willing to pay, the airlines make more money off the customer. (25% more money, on average.)

It’s a strategy that rug vendors in a Moroccan Kasbah have employed for thousands of years. They look at their customer and see how well he is dressed. They check out his shoes (…and his watch, his glasses, his cellphone…) and then alter their prices accordingly.

Chances are you’ve experienced this firsthand when purchasing a service or from an independently-owned business—say a car dealer or a jewelry store. Perhaps you’d gotten the distinct impression that they could tell just by looking at you how much they could upcharge and still make the sale.

Dynamic pricing works in very much the same way online—it’s just that computers use data instead of eyes. The airline you’re purchasing from online may not know you’re wearing an expensive suit while you browse, but they could very well know you bought an expensive suit due to tracking cookies in your browser. And while we’re talking price—you know the obscenely high rent you’re paying for that big-city apartment? Well, thanks to location tracking, it’s likely the airlines know as well.

On a very basic level, dynamic pricing has to do with supply and demand. If the airline’s computers know that the flights are going to be full then they will keep the prices high. They have decades of data they base these predictions on.

On the other hand, if they know that there are going to be empty seats, then they will open up lower-priced buckets or even sell business class upgrades at the check-in counter. (I once bought a business class upgrade on Turkish airlines for $800 at the airport—if I had purchased it earlier it would have cost several thousand.)

But in the past few years, the pricing methods of airlines have become even more sophisticated. For example, if you bought your ticket using a Mac, and your seat-neighbor used a Windows, you may have paid 30% more for your nearly identical seat.

Do you travel routinely? If so, you may also pay more for this. Airlines know your routine travel probably means you travel because you need to, and so it follows you’ll travel at any cost, however begrudgingly. This is why tickets are so often cheaper if you stay over a Saturday night. Business travelers (who airlines know will pay more) want to come home Friday night to spend the weekend with their honey.

Maybe it could be expected for dynamic pricing to come into play when purchasing expensive plane tickets, but what about when buying paperclips? A Wall Street Journal investigation found that the office supplies retailer Staples changes their pricing for products online depending on the location of the computer you’re searching from. Particularly noticeable are the discounts you’ll find if a Staples’ rival (like Office Depot) is within 20 miles from you.

“[D]ynamic pricing makes it even more difficult than it already is to get an unbiased price comparison,” writes Barbara Peterson of Travel Market Report. So what’s the solution?

Experts at travel agencies like Cook Travel have access to unpublished rates—this means that we can find the lowest fares anywhere, and we don’t need your Google search history to do it.