Gary Becker, who passed away this week, was a man who changed the field of economics. Before Becker, economics was the study of buying and selling things. But Becker realized that economics was really about tradeoffs, and that there are a lot of tradeoffs in the world that don’t involve money—or don’t only involve money. (For example, instead of writing this article, right now, I could be learning hip-hop dancing or starting a biotech company.)

One tradeoff Becker thought a lot about was workplace discrimination. Suppose that managers and executives are racist or sexist—for whatever reason, they just don’t want to hire women and minorities, or to pay them what they’re worth (pretty realistic, if you ask me). But this discrimination doesn’t come without a cost. If one company pays women and minorities less than they produce, they could jump ship. With a highly productive and relatively cheap workforce of women and minorities, a fair-minded company could out-compete a discriminatory company and drive it out of business.

Unless, of course, it can’t. Becker theorized that regulation and other government protections can shield discriminatory companies against attack. That would protect the jobs of the people who worked at those old-line companies, but would perpetuate workplace unfairness in the process.

In other words, Becker thought that competition kills discrimination. Open up the floodgates of dog-eat-dog capitalism, and women and minorities will win greater equality in the workplace.

If you’ve ever marveled at the progress women have made in the US economy, you can’t help but be intrigued by this story. After all, it was around 1980 that women really started to win economic equality. Though the female share of the labor force started increasing in the ’40s, the gender wage gap remained stubbornly flat, with women making only about 60% of what men made. Then, as if someone had flipped a switch, the gap began to shrink in the early ’80s. It shrunk and shrunk, to the point where people now debate whether it still exists at all. It does, but is small compared to decades past.

What happened in the early ’80s? Laws mandating “equal pay for equal work” had been around since the early 1960s, but the gap hadn’t budged. The feminist movement had been shifting cultural norms for decades, but why should it suddenly score big economic breakthroughs in the relatively conservative 1980s after years of frustration?

One explanation for women’s sudden success is that Becker was right. The early ’80s saw a wave of deregulation, and the start of a steady increase in trade as a percent of GDP. It also saw the advent of new forms of finance, designed to take power out of the hands of managers and put it in the hands of shareholders.

Remember the movie Wall Street, when Gordon Gekko declared that “greed is good”? The real-life version of Gordon Gekko was Mike Milken, the “junk bond king.” Milken and his firm, Drexel Burnham Lambert, pioneered the use of high-yielding “junk bonds” to finance corporate takeovers. Boosted by Milken’s financial engineering and a helpful 1982 Supreme Court ruling, corporate takeovers exploded in the 1980s. America’s managers and executives saw their cozy empires come under assault. Corporatism went into decline, and shareholder capitalism went into ascendance.

Under the triple assault of shareholder capitalism, deregulation, and globalization, corporate America at first withered, laying off millions in the ’80s. The old social contract, where large safe companies gave long-term safe jobs to millions of working Americans (mostly white men), broke down. Inequality and insecurity rose.

“Neoliberals” usually claim that these unfortunate changes were justified by the economic growth they produced. But if Becker was right, then the unrestrained capitalism unleashed in the 1980s had another unexpected benefit—increased gender equality.

If Becker was right, then Mike Milken was one of history’s most important feminists.

How credible is this explanation? As with all long-term macroeconomic phenomena, it’s not clear. A number of studies do support the Becker theory. A 1999 study by Sandra Black of the New York Fed concluded that deregulation and globalization probably contributed to a reduction in gender discrimination in the manufacturing and banking industries. And a detailed 2013 study by a team of Swedish economists found that corporate takeovers reduced the gender wage gap, especially in industries where competition was weak. Meanwhile, a 2014 paper by Andrea Weber and Christine Zulehner found that firms that discriminate against women tend to be outcompeted by firms that are fair to women. There is also evidence that increased competition and deregulation have reduced the racial wage gap.

Perhaps the most intuitively persuasive evidence in favor of Becker’s theory comes from looking at a country that has avoided deregulation, shareholder capitalism, and openness to imports: Japan. There are no Mike Milkens in Japan; in fact, regulation and the attitudes of judges make hostile takeovers completely impossible. Japan’s productivity notoriously lags that of the United States. And when it comes to gender equality in the workplace, Japan scrapes the bottom of the barrel.

As Japanese female employees struggle to keep their low-paying jobs while men with half their skill bask in the security of lifetime employment and guaranteed raises, it doesn’t take long before one begins to appreciate the amazing progress that American women have made in the workplace. That journey is not finished, of course–discrimination and a pay gap still exist. But we are far ahead of Japan, and that is something of which we should be proud.

Was Becker right? Was Mike Milken—that unlikely feminist hero, whose firm was itself notoriously sexist—actually America’s most important agent of gender equality? We’ll never know for sure. We should never discount the importance of the feminist movement, which at the very least prepared society to accept rapid changes in gender roles, and probably also contributed to the changes in the workplace. But neither should we ignore the positive side effects of unrestrained capitalism. In the end, bigotry doesn’t pay.