When Kamala Harris published her first book in 2009, recounting her experience as a California prosecutor, she called it “Smart on Crime.” That phrase would come to signal a kinder, gentler approach, but that is not how Ms. Harris meant it. She meant, the book’s marketing copy proclaimed, “making the criminal justice system truly — not just rhetorically — tough.”

By the time she ran for president in 2019, Ms. Harris was no longer talking tough. She called herself a progressive prosecutor and proposed to end the death penalty, mandatory minimum sentences and cash bail. The left was not buying it: Progressives said her record was “just slightly less awful” than that of traditional prosecutors who measured their success by their conviction rates. The left wing of the Democratic Party helped push her out of the race.

Now she is back to being a Top Cop. Ms. Harris’s central pitch to voters has been her record as a prosecutor who has put away “predators, fraudsters and cheaters,” and could therefore handle her opponent in the presidential race. “So hear me when I say,” she tells crowds in her stump speech, “I know Donald Trump’s type.” It’s a refrain that voters are sure to hear repeated at the Democratic National Convention in Chicago next week.

Ms. Harris’s repositioning could be read as opportunistic flip-flopping or, more charitably, as one person’s evolution. But it is also a mirror. Her move from tough to progressive closely tracked society’s changing views on crime and criminal justice, as it became clear that the war on drugs had failed to end the drug trade and ever-tougher sentences had left America with the world’s highest incarceration rate.

In 2009, when she published “Smart on Crime,” one in four Americans said they had “very little” confidence in the criminal justice system, according to Gallup. Ten years later, when she ran for president, it was more than one in three. And by that point, support for reform cut across party lines, with about two-thirds of Republicans agreeing that the system gave unfair advantages to the rich and 40 percent favoring the decriminalization of drugs.