We may assume that voters make their choices after carefully studying candidates and their positions on issues.

That assumption lies at the heart of earnest efforts in news media and elsewhere to provide voters with as much objective information as possible.

However, we also know that voters often make snap judgments based on ideological predispositions and unpredictable events that unfold during campaigns, what those in politics call “x-factors.”

WhatMatters: Your daily guide to ​California policy & politics.

One of this year’s more interesting situations is in Sacramento County, where the Democratic registration advantage over Republicans, 43.6 percent to 27.1 percent, mirrors the statewide split.

For years, it’s grated on local Democrats that Republicans hold the county’s top two law enforcement offices, District Attorney Anne Marie Schubert and Sheriff Scott Jones. While past efforts to dislodge them have failed, both face potentially viable challengers this year.

When Stephon Clark, a young black man, was shot and killed by two Sacramento city police officers on March 18 under very questionable circumstances, the city erupted in protests, directed at the city’s police department.

Very soon, however, the protests were redirected at Schubert and Jones for reasons that don’t seem to make much sense.

Demonstrators demanded that Schubert prosecute the two cops, but she quite properly said that she couldn’t make a decision until after an investigation had been completed.

When a sheriff’s deputy’s patrol car bumped and injured a demonstrator, Jones came under fire, and he fanned the flames by suggesting that some of the protesters at the event were hired to instigate violence.

“We do know, because of our intelligence and because of our history with these folks, that there are paid protesters and paid people to instigate,” he said.

The county’s leading Democratic politician, Sacramento Mayor Darrell Steinberg, who should have been on the defensive over Clark’s death at the hands of two city cops, jumped on Jones over the patrol car incident.

“I wasn’t pleased with what I saw Saturday night. At all,” Steinberg said in an interview with Capital Public Radio. “We have a great police chief in this city, who understands the pulse of the community and who represents the men and women of the police department, but he’s also of the community. And that’s in contrast to what we saw Saturday night.”

Later, the political aspect of the situation became obvious, when Shaun King, a national leader of the Black Lives Matter movement, addressed a Sacramento rally, glossed over the fact that Clark was killed by two city police officers, and called for Schubert and Jones to be ousted.

However, as the furor over Clark’s death continued, something else happened that could alter Sacramento’s political equation.

Last week, Schubert and Jones jointly announced that a DNA-aided investigation had solved one of the state’s most vicious crime sprees with the arrest of Joseph James DeAngelo. He is the man, they said, who was known as the “East Area Rapist” in Sacramento and the “Golden State Killer” elsewhere and whose rapes and murders terrorized the state in the 1970s and 1980s.

Their announcement blew the Stephon Clark case off the front pages and the evening newscasts. Suddenly, two officials who had been on the political defensive were seen as heroes for solving a case that had puzzled investigators for decades.

Did it ensure their re-election? We’ll see, but the political impact of two x-factor incidents looms large.