A gallon of milk: $7.59.

Outrageous! That was twice what I spent in town the day before. One lousy gallon of milk, and I would have to file for bankruptcy. Whoever was responsible was a rotten price gouger. But I didn’t have a choice; the potatoes were already boiling. I grabbed the milk, sulked up to the counter, and coughed up the money.

You see, my brother was cooking a meal for the family: ham, vegetables, and mashed potatoes. He’d already started. The potatoes were peeled, cut, and boiling on the stove. My job was to get the milk — you can’t properly mash potatoes without milk.

We were in the middle of rural Virginia, where the closest grocery store was a half hour away. I’d secured the milk the day prior, but I accidentally left both gallons in the car, sitting in the sun. Luckily, there was one gas station that stocked necessities, a few miles down the road.

When I arrived, I walked to the back of the store and saw the last gallon of milk remaining. It had a bright orange sticker slapped on it, notifying customers of its new, astronomical price. After purchasing it, I hadn’t even reached my car before the economic lesson dawned on me: I was extremely fortunate the milk was so expensive.

In hindsight, it’s obvious. Why wasn’t the store completely out of milk? Because all the customers before me didn’t purchase that last gallon. They were more revolted by the price than I was. And thank goodness, because otherwise I would have failed my mission. I didn’t have time to travel a half-hour to and from town. Dinner would have already ended, mashed potato-less. Instead, thanks to the price markup from the store manager, I returned home triumphant, with plenty of time to enjoy dinner. The final product was creamy and delicious.

The Bigger Picture

We live in a world of scarce resources. There just isn’t enough milk available to satisfy every human demand. In a perfect world, perhaps milk would be free and abundant. You could snap your fingers and have an unlimited supply at your disposal. But that’s not the world we live in. At the store, there was one gallon of milk remaining and certainly more than one person who could use it.

Who should get the last gallon?

The answer teaches us a second economic lesson: resource allocation. In a world of scarcity, resources would ideally be allocated to those who want them the most. If I am desperate for water, it would be a shame if somebody bought every bottle in the store to water their houseplants. We need some kind of system for the coordination and conservation of scarce resources. This is precisely the role of prices in a free market.

A price represents what a buyer must give up in order to purchase a good. The higher the price, the more you have to give up. The lower the price, the less. So, when any good is in short supply — when only one gallon of milk remains at the store — the price goes up, and it gets allocated to those willing to give up the most for it. In my case, I probably valued that gallon of milk more highly than anyone in town, and I paid accordingly.

Which brings up a third lesson: the manager had no idea. We never met. I didn’t have to explain why I needed the milk more than my neighbors. Nobody needed to understand economics. The man was simply acting in his self-interest, without any central planning or direction, and he unwittingly coordinated scarce resources to their most highly valued ends. By raising his prices — what often is seen as cold profit-maximization — he essentially told the entire community, “Hey! We’re low on milk! Only those who really need it can buy it!” Concretely speaking, this small action was directly responsible for giving my family a nice, peaceful dinner together.

But it doesn’t stop there. Think long term. By raising his prices, the storeowner made a larger profit. He was rewarded for his sensible decision. Who, in an ideal world, do we want coordinating scarce resources? People like him. And in a free market, this is precisely what happens. The better the businessman, the higher the profit he makes, and the more resources he’s able to allocate.

The same is true in reverse. The businessman who doesn’t maximize profits — who never raises his prices and always has a shortage of inventory — will be outcompeted in the long run. If he’s doing a bad job, if he keeps making losses, then bankruptcy is inevitable. This, too, is desirable in a world of scarcity. If people waste resources, then the sooner they go bankrupt, the better.

Say the small-town grocery store owner makes outrageous profits. He keeps his milk prices at $7.59 indefinitely. In a free market, this is nothing to worry about, either. High profits are signals to other entrepreneurs to enter the market: if they offer the same good at a lower price, they can steal customers away from the price gouger and make a profit themselves. Before long, this competition will drive supply up and prices down, creating even more value for society.

And now, we arrive at the final, dizzying lesson: this coordination happens all the time, every day, for tens of millions of prices. Supplies and demands of various goods are constantly in flux. When the price of steel goes up, for example, it causes a ripple effect throughout the entire economy. Everybody changes their behavior accordingly, from car salesmen to factory workers. And in virtually every case, nobody knows why — the market mechanics are behind the scenes, without any central coordination or awareness.

This is precisely why markets work so well. Huge amounts of information about the relative scarcity of goods are transmitted through the price mechanism, but each individual actor only knows a tiny part. By simply acting out of self-interest — by trying to maximize profits — the efficient allocation of resources emerges from the chaos; it isn’t deliberately planned.

So, the next time you see a high price, instead of grumbling as I did, think of the bigger picture: that entrepreneur is reserving a scarce good for the person who values it the most. In fact, it’s the duty of a responsible business to raise prices when necessary.

The free market, rightly understood, looks remarkably similar to an ideal system. It isn’t perfect, but given the constraints of the real world, it is the best option we have. It can turn the greediest business people into value creators for the entire society — even without their own knowledge or approval.

I can say without hesitation, after paying $7.59 for a gallon of milk, thank goodness for those dirty, rotten price gougers.