There are four men left on death row in Virginia, and only 31 people were sentenced to death in the entire U.S. last year, compared with more than 300 per year in the mid-1990s. The numbers are stark, but if you ask the experts — lawyers, scholars, activists, judges — why the death penalty has begun to fade in the U.S., you get all sorts of answers, many of them frustratingly vague.

The crime rate dropped, so there have been fewer murders to punish. A few states abolished the punishment outright. The cost of death penalty cases went up, and prosecutors grew worried about their budgets. States passed laws making life without parole an option for certain aggravated murders, meaning there was a sufficiently harsh alternative to the death penalty. All those DNA exonerations raised the specter of an innocent person being killed. In elections for district attorney, voters in Houston and Philadelphia replaced death-penalty champions with skeptics.

University of Virginia law professor Brandon Garrett’s new book, “End of Its Rope: How Killing the Death Penalty Can Revive Criminal Justice,” represents a major new effort to untangle these factors. He also analyzes the decline for lessons that might be applied to the criminal justice system as a whole. We discussed his findings by email, and his answers have been edited for length.

Let’s start broad: Why has the death penalty declined?

No one expected this to happen. After all, the death penalty has long stood for the ultimate in punishment, and it has been very popular for decades. I felt that understanding the great death penalty decline might help to show us how we can turn away harsh punishment more broadly.

At the county level, my colleagues and I observed a strong statistical connection between murder rates and death sentences. But while declining murder rates matter, it is not the only explanation. Death sentences fell far more steeply than murders did. Unfortunately, while the decline in murders played an important role, when Alex Jakubow, Ankur Desai and I analyzed the past 25 years of death sentencing data, we found a strong county-level pattern of racial bias. Counties with more black residents have more death sentences. And counties with more white victims of murder have more death sentences. Call it a “white lives matter” effect.

We also found a muscle memory effect. Counties impose far more death sentences just as a function of having done so in the past. This inertia is powerful. And yet today, when prosecutors seek the death penalty, they are more often failing to convince jurors to impose it. That reverses the muscle memory in these offices; to lose an expensive death penalty trial is no trivial matter. In 15 death penalty trials since 2015 in Texas, only eight have resulted in death sentences. In Virginia, prosecutors failed to get death sentences more than half of the time in trials since 2005. Rural counties have fallen completely off the death penalty map; just a handful of relatively populous counties still have death sentences.

What I call a “defense lawyering effect” also played an important role in this death penalty decline. The states that created offices for defense lawyers experienced significantly more pronounced declines in their death sentences. The states that continue to leave it to local judges or counties to decide who handles death penalty cases have more death sentences.

What caused defense lawyering to improve? Supreme Court rulings? Culture? Something else?

Defendants on trial for their lives long received incompetent lawyers: lawyers who fell asleep in court, showed up drunk, used racial slurs to refer to their clients, and worse. In the 1980s, states all imposed cut-rate caps on defense in death penalty cases. They stacked the deck for prosecutors.

In the decades since, states gradually created offices to handle capital defense. They realized that they might risk constitutional challenges in the courts if they continued to handicap the defense. But they also discovered that defense offices can do the work far more cheaply than independent lawyers appointed by judges.

Social workers hired on staff are much cheaper than lawyers paid by the hour. And social workers, called mitigation investigators, know how to research a person’s medical, mental health, foster care and school records. They know how to speak to victims of childhood abuse and to addiction counselors. In the past, the jury never heard about the background of the person they convicted of murder. They had no reason not to sentence a murderer to death. Now, even in high-profile cases like the Aurora, Colorado, mass shooting, they hear mental health evidence and often choose life.

The worst murders are often committed by people with serious mental health problems. It takes minimally adequate resources to piece together a person’s social history. But in states that continue to deny the defense basic resources needed, you see more death sentences. Later this fall, the Supreme Court will hear a case, Ayestas v. Davis, about the courts’ refusal to grant resources to the defense for investigation.The Supreme Court has said that there is a constitutional obligation to meaningfully investigate mitigation, or social history evidence, in death penalty cases. But my research suggests that it takes more than a judge willing to award fees case by case. It takes an office to ensure that obligation is met.

We've looked in the past at how rising costs are leading prosecutors to not ask for the death penalty. Does that relate in some way to the quality of the defense lawyers?

People used to assume that executing someone would save money: You wouldn’t have to keep a murderer fed and housed in prison for all of those years. Now it is common knowledge that, in fact, the death penalty is orders-of-magnitude more expensive than imprisonment. Local government spends millions on just a single death penalty trial, and states spend hundreds of millions, even billions of dollars, on appeals, habeas and everything else involved in keeping the death penalty on the books. Those costs are even more troubling, of course, if the defense does a more effective job and prosecutors spend millions on a trial at which the jury rejects the death penalty in the end. States have fewer death sentences to show for the millions and billions they spend. Law enforcement has started to push back and say that there are far better uses for those vast sums of money.

Another common argument for why the death penalty is disappearing is that jurors are responding to the high rate of exonerations — they don't want to be wrong and send someone innocent to death. But you've shown that isn't quite right. Can you explain?

Twenty innocent people have walked off of death row in this country after DNA tests exonerated them, and over 100 more have been exonerated by other evidence. These death row exonerations have forever changed the way we think about the death penalty — and we do not even know how many innocent people have been executed in this country.

Polling indicates that people are increasingly concerned about sending innocent people to death row. That may play a role in declining public support for the death penalty. However, people who oppose the death penalty outright cannot sit as jurors in a death penalty trial. So, exonerations have so far not stopped states like Florida, that have seen the most exonerations, from sentencing comparatively more people to death. Death-row exonerations keep happening.

If the crime rate goes back up, do you think there will be more death sentences, or have these standards of better lawyering changed the game enough to survive big political shifts? What happens if there is a return to the murder rates of the 1980s?

The American death penalty has always been more about political posturing than a genuine attempt to make the punishment fit the crime. Meanwhile, crime continues to decline. If murder rate trends do completely reverse, then there could be pressure to take more tough-on-crime approaches. But I think people have learned the lesson the hard way that you can’t death-sentence or imprison your way out of crime. We now know when jurors hear the whole story, even in death penalty cases, they are reluctant to impose death sentences. Even if more prosecutors suddenly started seeking the death penalty, the results would likely not be good for them.

In your book, there is a tension about the future: On the one hand, the decline of death sentences has shown how “mercy” among jurors can triumph given the right conditions; on the other hand, the decline has led to a massive expansion of life-without-parole sentences, which Pope Francis has called "hidden death sentences." How do you resolve that tension? What do you think opponents of long sentences should do going forward to bring more mercy into the system?

Only about 2,800 prisoners sit on death row today, but over 50,000 prisoners are serving life without parole, and about 200,000 prisoners have life sentences, according to a Sentencing Project report. I tell the story in my book of Joseph Sledge, who received two life sentences, and since he did not get a death sentence, he was not entitled to receive lawyers from the state once his appeals ran out. For decades, he filed habeas petitions himself and wrote letters. After almost 40 years in prison in North Carolina, a letter to an innocence project led to DNA tests that proved his innocence.

We need to do something about the explosion of these life sentences in America. We have replaced the death penalty with the “other death penalty.” Even juveniles can still get life-without-parole sentences, although the Supreme Court has said it cannot be mandatory. To imprison people, sometimes very young people, with no hope of release or redemption is inhumane.

Brandon Garrett is the White Burkett Miller Professor of Law and Public Affairs and Justice Thurgood Marshall Distinguished Professor of Law at the University of Virginia School of Law.