The researchers, Monica Alexander, a statistician with the University of Toronto; Mathew Kiang, an epidemiologist at Stanford; and Magali Barbieri, a demographer at the University of California, Berkeley; published their study in the journal Epidemiology.

With additional analysis at The Upshot’s request, Mr. Kiang calculated that had the African-American population’s mortality rates caused by prescription opioids been equivalent to those of whites, black Americans would have experienced 14,124 additional deaths from 1999 to 2017.

It’s a counterfactual analysis that relies on some large assumptions. Among other things, the projection assumes that the public health and medical response to the epidemic would have remained the same even if the African-American mortality rate had been higher. And it doesn’t take into consideration any potential changes in overdoses from heroin and fentanyl had African-Americans had greater access to prescription opioids. Still, Mr. Kiang found the results “fairly remarkable in at least two ways.”

“First, it’s a good example of how more medical care is not necessarily a good thing,” he said. “Second, it’s an extremely rare case where racial biases actually protected the population being discriminated against.”

A crackdown in recent years has reduced opioid prescribing over all, “and the racial/ethnic gap in opioid prescribing has narrowed,” said Mr. Kiang, but he said it was unclear whether the gap had closed entirely.

In recent years, drug overdoses have risen sharply among black Americans, particularly among older heroin users in places where fentanyl has become widespread. One reason that the death rates from heroin and fentanyl have converged between black and white people may be simple: Heroin and fentanyl are readily available outside the health system, so they’re less affected by bias within it.

The public response to drug epidemics also tends to diverge along racial lines. During the crack epidemic, there was a greater emphasis on punishment and incarceration. With the opioid crisis primarily affecting white people, there has been more emphasis on empathy and rehabilitation. (This same disparity was seen in crack versus powder cocaine.) Race played an obvious role in the policy response, Dr. Kolodny said: “From ‘Arrest our way out of it’ to, ‘It’s a disease.’”