But many criminal justice experts say that the size of the disparities undercuts the basic promise of equal protection under the law.

“Letting local prosecutors enforce state laws differently throws all notions of equality under the law out the window,” said Peter Wagner, executive director of the Prison Policy Initiative, which advocates reducing incarceration rates. “This data puts governors and legislative leaders on notice that if they want to put criminal justice reforms into effect, they need to look at how prosecutors use and abuse their discretion.”

The analysis is based on previously unpublished data from the Department of Justice on state prisons, which hold the vast majority of American inmates sentenced to a year or more.

The divide does not appear to be driven by changes in crime, which fell in rural and urban areas at roughly equal rates, according to the F.B.I. Instead, it reflects growing disagreement about how harshly crime should be punished, especially drivers of the criminal justice system like theft, drugs, weapons and drunken driving.

Cities have adopted a more lenient approach to drug offenses in particular, diverting many low-level drug offenders to probation or treatment rather than to jail.

Those choices have started to reverse — if only modestly — longstanding racial disparities in American prisons, where blacks and Hispanics are incarcerated at drastically higher rates than whites. The annual number of new black prison inmates fell by about 25 percent from 2006 to 2013, and the number of Hispanic inmates fell by about 30 percent, while the number of new white inmates fell by only about 8 percent, according to the most complete federal data.

The number of black prisoners is still “shockingly high,” said Marc Mauer, executive director of the Sentencing Project. “Nonetheless, these numbers are encouraging. It suggests that this is not necessarily an intractable problem.”

But rural, mostly white and politically conservative counties have continued to send more drug offenders to prison, reflecting the changing geography of addiction. While crack cocaine addiction was centered in cities, opioid and meth addiction are ravaging small communities like those in Dearborn County, where 97 percent of the population is white.