Over the last two decades, working-age American men have been ever so quietly exiting the labor force. These days, around 12% of prime-age men, those between 25 and 54, are neither employed nor looking for work—up from around 8% in the mid-1990s. During that same time, and nearly as quietly, America began pounding painkillers: between 1999 and 2015, sales of prescription opioids per person more than quadrupled.

Coincidence?

Probably not. That spike in opioid prescriptions could explain around 20% of men’s workforce attrition, according to a new working paper by Alan Krueger, a Princeton University economics professor. The study, which was published by Brookings, suggests that America’s opioid epidemic is not merely a health emergency. It’s increasingly an economic crisis too.

Krueger’s analysis focuses on explaining a more general decline of the US labor force, a phenomenon that has frustrated employers and scholars alike—and one that long predates the opioid crisis. A good deal of that trend is thanks to the aging of the overall population, as well as to the fact that a rising share of young workers are pursuing degrees instead of paychecks. On top of that, working women, who propelled American labor force participation in the second half of the last century, can no longer be counted to work at higher rates.

The increase in working women from the 1950s masked another trend that began then, when some 97% of prime-age men had jobs or were looking for one. These days, Italy is the only OECD country with a higher share of prime-age males who don’t want to or can’t work.

And it’s on this question—what are these would-be workers doing with themselves?—that Krueger’s work sheds the most intriguing light.

First there are the staggering connections. Nearly half of prime-age men who have ducked out of the workforce take painkillers on a daily basis, Krueger finds. And around two-thirds of those men take prescription pain meds each day—which translates to about 2 million men. The areas hit hardest by the opioid crisis also saw the steepest drop in labor-force engagement, according to his analysis. For instance, in counties with the most men dying from alcohol abuse, suicide, and drug overdoses at increased rates—what economists Angus Deaton and Anne Case call “deaths of despair“—only 73% of prime-aged men remain the workforce. That’s more than 10% below the national average (pdf, p.21).

However, Krueger’s work suggests a more obvious—and less existential—answer than post-industrial malaise. Areas where doctors prescribed more opioids also experienced higher rates of painkiller use. And over the last 15 years, the counties where more opioids were prescribed saw bigger drops in workforce participation. This finding held—even after controlling for changes in manufacturing employment (as well as other factors).

“This suggests that opioid overdoses aren’t only due to ‘despair,'” argues Janet Currie, another Princeton economist who wasn’t involved in the study. “They also reflect and respond to the supply of prescription opioids, which in turn reflects doctor behavior.”

In other words, the huge regional variation in the opioid crisis’s severity reflects differences not in underlying mental or physical health problems, but in medical practices.

To be clear, we still don’t know whether the explosion in opioid prescription is causing labor force detachment, or vice versa. And there’s mounting evidence that disengaged workers, especially prime-aged men, may have a serious health condition that precludes work.

More than half of prime-aged men who don’t want to work report spending their day in pain—and close to half medicated the day before. Prime-aged men in particular are significantly less happy and more stressed than their employed and unemployed counterparts, says Krueger. And they find their lives less meaningful. These men are more than eight times as likely to be in poor health than both employed and unemployed men. They also face substantially higher rates of disability, which have only worsened over the past decade.

Things are much different with women—or at least, on the face of it they are. Prime-aged women who are not in the labor force are happier and less stressed than women of the same age in the workforce. They also find their lives more meaningful than unemployed women, on average. But these differences in men and women’s social well-being melt away when you drop women who aren’t caregivers, suggesting that life purpose, for this age group, is critical to happiness.

Krueger’s analysis challenges the narrative that health problems unique to hollowed-out manufacturing centers have driven opioid abuse. It also tests conventional wisdom that the slackening of America’s workforce results from stagnating wages—especially for less educated male workers—that have discouraged participation. Last year, the White House threw its weight behind this theory. In a 47-page report, the Council of Economic Advisors called for new job opportunities, training programs, increased workplace flexibility, higher wages, and much else besides.

It’s likely that both demand and supply-side factors play a role. But Krueger’s analysis suggests that expanded health care insurance, preventative care, and better pain management could help middle-aged men return to work—and, hopefully, find purpose again.

But that still leaves us with Krueger’s most sobering observation: the swelling abundance of painkillers in America has barely made a dent in people’s pain. “Despite the massive rise in opioid prescriptions in the 2000s,” Krueger notes, “there is no evidence that the incidence of pain has declined.” On the contrary, his analysis suggests a small uptick in pain among prime-age men who are either out of the workforce or unemployed. Economics may be suited to unscrambling the enigmas of which pills we swallow and why we work when we do—but not to the more nebulous questions of why we hurt.