This article is adapted from The Inner Lives of Markets: How People Shape Them—and They Shape Us.

Canice Prendergast is an economics professor at the University of Chicago’s Booth School of Business. He works in the language of dense mathematical models that aim to clarify why, for example, service at airport security is so dismal and why that might actually be a good thing. (Because a few of the Department of Homeland Security’s “customers” may be bomb-carrying terrorists, it’s not exactly a customer-is-always-right setting.) He’s a serious enough art collector that when Booth built a $125 million campus across the way from Frank Lloyd Wright’s landmark Robie House, Prendergast was put in charge of a million-dollar budget for decorating its hallways. Instead of the usual array of bland landscapes and oil paintings of old white men in suits that populate the walls of many business schools, Booth’s walls are filled with abstract, conceptual works that challenge and often mystify its faculty and students.

Some years ago, Prendergast’s colleague, Robert Hamada, invited him to join a working group at America’s Second Harvest (now called Feeding America), a clearinghouse that takes surplus food from grocery stores, food producers, and farms and distributes it among a network of food banks across the country. The two economists were to be joined by two other Chicago Booth professors, operations professor Don Eisenstein and an expert in organizational behavior, Harry Davis.

As with many successful organizations, Second Harvest has its founding legend, in this case the story of John van Hengel, a retired businessman working at a Phoenix soup kitchen. One day, the organization recounts on its homepage, van Hengel “met a desperate mother who regularly rummaged through grocery store garbage bins to find food for her children. She suggested that there should be a place where, instead of being thrown out, discarded food could be stored for people to pick up—similar to the way ‘banks’ store money for future use. With that, an industry was born.” After inventing the food bank industry, van Hengel went on to found Second Harvest to better allocate donations across the various food banks that were popping up across the country.

By the time Prendergast and his colleagues appeared on the scene, the clearinghouse worked something like this: A donor company, say Kraft, would notify Second Harvest that a load of macaroni and cheese was available for pickup. Second Harvest management would then offer the shipment to one of 200 food banks around the country based on need, proximity to the pickup locale, and a formula that dictated how many pounds of donations each affiliate was entitled to each year. The local food banks were responsible for shipping the donation. Once the food arrived at the affiliate’s warehouse, volunteers sorted it, entered it into a computerized grocery list, and made it available for local charities that served the hungry and poor.

By all accounts, it was a reasonably well-designed and well-functioning system. By 2004, Second Harvest was shipping a truly remarkable 1.8 billion pounds of food annually. GuideStar, a charity watchdog group, gave Second Harvard a rating of four stars out of a possible four.

It may have been a reasonably good setup, but it was far from optimized. Food banks might provide feedback on their likes and dislikes, but at its core, the Second Harvest allocation still resembled 1960s-era Chinese central planning (which, free-market economists will note, helped to cause the Great Famine of 1959–61). Second Harvest’s management felt that it was falling short in its efforts to get food banks the donations they most needed. Prendergast gives the example of sending potatoes, unbidden, to a foodbank in Idaho that already had warehouses full. Or delivering milk to a bank that didn’t have the refrigeration capacity to store it and so would end up throwing it away. In fact, Second Harvest would sometimes turn down food donations from giant food companies because they weren’t sure where to send it. Second Harvest was also, at the time, treating different kinds of food as the same—a pound of broccoli was the same as a pound of cereal was the same as a pound of potato chips. When it comes to feeding the poor and hungry, however, not all foodstuffs are of equal value. This wasn’t an efficient state of affairs, and both Second Harvest as well as its food banks recognized its shortcomings.

Early on, Prendergast and his colleagues brought up the idea of using something like a market instead. As Prendergast imagined it, the currency in a Second Harvest market would be points, or shares, that would be distributed among the member food banks. These shares could then be bid on food donations as they arrived in Second Harvest’s system each day. In a sense, nothing would change. Kraft would offer a container load of mac and cheese, and it would be allocated to a food bank affiliate to feed the hungry. But instead of being distributed by Second Harvest’s central office, the food bank that wanted it the most would express that preference by parting with precious shares to get it.

The nine food bank presidents who comprised the rest of the working group did not all greet the idea of using markets to fix their not-really-broken system with a standing ovation. It may not have helped that the pitch came from a group of University of Chicago economists, whose ranks include libertarian extremists like Milton Friedman (of school voucher fame) and Gene Fama (who developed the efficient markets hypothesis for stock trading). Prendergast recalls that at some point during the preliminary discussions, John Arnold, then president of the West Michigan Food Bank, stood up and announced, “Look, I’ve got to tell you guys. I’m a card-carrying member of the American Socialist Party. I was a conscientious objector. I have no interest in using your fucking market.”

From where the socialist, peace-loving Arnold sat, markets looked first and foremost like institutions of exploitation, not allocation. That’s why he worked for a food bank rather than Monsanto or the Chicago Mercantile Exchange. But to Prendergast and his colleagues, Arnold’s attitude was misguided. Under their proposed system, no money was to change hands. Kraft, Kroger, and others were donating their food, not selling it (though they did receive a tax write-off), and America’s Second Harvest, itself a charity, wasn’t taking any cut of the proceeds. A market or marketlike system would simply be a better way of efficiently matching the supply of food donations to food bank needs.

It didn’t look so benign from Arnold’s office in Comstock Park, Michigan, where it seemed more like the market was what created the problems of hunger and homelessness he was fighting against. The market somehow allowed executives in Detroit to earn seven-figure salaries they didn’t deserve to buy million-dollar homes they didn’t need while he struggled to keep from getting buried under the millions of pounds of groceries that he distributed each year with barely enough funding to hire a single full-time administrator to help him. (Arnold and his assistant earned barely more than $100,000 a year between the two of them—enough for a comfortable life in the Midwest but practically a rounding error for a corporation’s executive payroll.) If life wasn’t fair, the market was at least partly to blame. Arnold saw the way markets served as a vehicle of exploitation and lost sight of their potential usefulness in food distribution.

It soon became clear to the Booth team that the main barrier to improving Second Harvest’s distribution system wasn’t devising an efficient market. The bigger challenge was making it seem fair to skeptics like Arnold. The only way the invisible hand was going to work its magic for Second Harvest was if Arnold could see what was in it for him and for the people his charity served.

Prendergast is modest about his accomplishments. When we told some of his economics colleagues about his work with Second Harvest, none of them had heard about it. And he is notably understated in describing his contribution to making Second Harvest’s food donation market the success that it became; he gives most of the credit to Harry Davis.

Among social scientists, economists have a reputation of being “undersocialized.” It’s not just that we’re awkward and ill-mannered (although that’s true at times as well). The deeper critique is that economic models fail to capture the nuances of human relations. Davis was trained in sociology (what many economists would call an “oversocialized” field). Davis thought a lot about human relationships: He was a good listener, he was able to draw out the concerns that Arnold had, and he was able to work with his market-minded colleagues to devise a system that addressed them.

Arnold’s fear wasn’t that Kraft or General Mills would somehow abuse a Second Harvest market. Instead, he was worried about exploitation by other food banks. He and his assistant did everything at the West Michigan Food Bank, from helping volunteers stock shelves to filing their own tax returns. (If you look them up on GuideStar, you’ll see their returns are filled in by hand.) They didn’t have time to track bids in an eBay-style auction for food donations, and they didn’t have the money to hire someone to do it for them. Second Harvest affiliates in Chicago, New York, and L.A.—titans of the food bank world—had dozens of staff members and hundreds of volunteers who could monitor auctions in real time, possibly swooping in at the last moment to snatch the choicest shipments.

And that’s presuming Arnold ever had a shot at a truckload of Skippy at all. Under the initial proposal, shares were to be allocated based on the poverty head count in each affiliate’s service area. The same food banks with the staff to track food auctions in real time were also located in population-dense urban centers, which would entitle them to a higher allocation of shares. They’d always end up getting the good stuff. Arnold was actually worried that he might never get any food at all, given that the “rich” big-city food banks would always have a full enough war chest to outbid him.

Finally, even if Arnold did have the time and shares to compete with the big boys, how would he know how much to bid? New York was distributing container-loads of peanut butter and jelly every month. Arnold could last half a year with one shipment. So when it came time to get more, how would he know how high to go? Not only would he have fewer points than larger food banks, he also might end up wasting them by overbidding.

The design of Second Harvest’s market took these and other anxieties about potential inequities between large and small food banks into account. Instead of an eBay-style system of shipments that appeared and expired in real time based on the flow of donations, offers accumulated throughout the day. Then, the following morning, each food bank would receive the full list of items up for bid to consider. Every food bank would have the opportunity to review the listings and make its best offer on each one through a sealed-bid auction. The winning bidder would send a truck to collect the donation, and the shares from its winning bid would get split up among the rest of the food banks in the Second Harvest network.

This last point might not seem like a big deal: If everyone gets some extra shares, then it won’t make anyone richer; it’ll simply make prices rise through more aggressive bidding. But, Prendergast recalled, it totally changed the psychology of losing an auction from “the rich bastard outbid me again” to “that chump overpaid again—more shares for me!”

One unexpected consequence of becoming a market designer was that Prendergast found himself playing the role of central banker. Central bankers manage money supply, and they do so in large part to keep prices steady. Price stability was also a major concern of small food banks: Since they made relatively infrequent purchases, historical prices provided them with guidance on how much to bid.

For the Federal Reserve (the United States’ central bank), this involves too many complications to enumerate here—from figuring out how many $100 bills in circulation are hiding under Russian mobsters’ floorboards to assessing investors’ beliefs about future money supply (which may make them spend, or stuff more bills in mattresses), and so on.

Prendergast faced many similar challenges in managing Second Harvest’s economy, albeit on a much smaller scale. It turns out that there’s a Depression baby inside of each of us: Food bank presidents, the market designers discovered, were hoarders of shares. To keep the market from dipping into a deflationary spiral, Prendergast needed to pump extra shares into the market to encourage bidding. There was also the ebb and flow of goods into it to consider. Some days, Kraft might dump half a dozen container-loads of mac and cheese into circulation; other days there’d be none. If everyone used their points to bid on mac and cheese, the prices of, say, potato chips and broccoli would plummet, not because broccoli was suddenly worth less, but because of a temporary surge in the supply of more desirable donations. So extra shares would need to be put into circulation to prop up prices—lest Arnold see last week’s lower price of potato chips and bid too timidly on them, misinterpreting short-run price declines as permanent ones. Similarly, in a dry spell of donations, shares would be withdrawn from the market: Since there was so little to bid on, there would be a run-up in prices unless the number of shares also declined.

Another unanticipated consequence of “marketizing” food distribution—this one positive—is that prices gave Second Harvest’s leadership a sense of what kinds of donations were most valued by affiliates. Prices revealed that peanut butter and noodles were the two food types most valued by food charities. Frozen chicken wasn’t far behind. They’re all storable, calorie-dense, reasonably nutritious foods that people will actually eat. In a free-market economy, these signals would motivate suppliers to ramp up production of popular items or motivate new entrants to enter the popular market. In the charity context, popularity didn’t matter to the suppliers, but it motivated the central office at Second Harvest to hunt more aggressively for donors of frozen chicken and peanut butter, less so for potatoes, and least of all for potato chips. In fact, chips, a bulky, fragile junk food, are so little valued by food banks that sometimes their prices turn negative, so a food bank receives shares in exchange for the cost and hassle of picking up the shipment. Kale and broccoli were better than Doritos, but not by much; you can’t feed the hungry if all you give them is stuff they can’t cook or won’t eat.

(We asked Prendergast why Second Harvest even accepts potato chip donations, or why they don’t just send a garbage truck instead of a delivery van and pulverize them on site. He pointed out the need to maintain their relationships with the very same chip-producing donors who also make the peanut butter, chicken, and pasta that food banks do want and need. If Second Harvest needs to absorb a shipment of chips to keep big agriculture happy, so be it.)

Second Harvest management was thrilled with the results. As Prendergast reports in an academic paper summarizing the Second Harvest market experiment, the annual supply of food donations increased by 50 million to 100 million pounds as a result. Twelve million pounds can be traced directly to the market itself, in the form of excess donations that flush food banks placed into the market in exchange for shares. That’s 12 million pounds of food that would otherwise have been wasted. Based on his analyses, Prendergast estimates that if anything, the smaller food banks benefited the most from the new system.

And what did John Arnold of the West Michigan Food Bank think of the shift to a food distribution market? He quickly went from being its chief skeptic to one of its most enthusiastic users and supporters, logging on to the online marketplace system first thing each morning in search of grocery bargains.

Arnold died in 2012, but if you were to ask him if he saw any contradiction between his enthusiasm as a Second Harvest market participant and his membership in the Socialist Party of America, we don’t think he would. He may never have abandoned his view that American capitalism is the means by which the rich get richer. But he also came to see that the Second Harvest market was just a really good way for him to get what he needed to feed the hungry in West Michigan.