No matter which candidate for Suffolk County sheriff is victorious on Election Day, the winner will be someone with law enforcement experience—thanks to a primary last month.

Originally, the Suffolk Republican Party designated State Senator Philip Boyle of Bay Shore to run for sheriff. But Lawrence M. Zacarese, deputy chief of Stony Brook University Police and a former New York City police officer, emphasizing that Mr. Boyle had no law enforcement experience and this was “crucial” for the post, challenged him in a GOP primary, and won.

Although the choices of party leaders and committee people often win in primaries, Mr. Zacarese pulled an upset. “This has been the epitome of an outsider grassroots campaign against a big machine,” said Mr. Zacarese of Kings Park following the primary. “The voters spoke with an overwhelming message that they want a qualified candidate for sheriff.”

Meanwhile, the Suffolk Democratic Party had designated Dan Caroleo, a retired New York City police officer from North Babylon, to run for sheriff. but he abruptly dropped out. He was replaced by a former Huntington Town councilman, Stuart Besen, an attorney with a specialty in personal injury cases. The word in Suffolk political circles was that the Suffolk Democratic leadership was getting set to endorse GOPer Boyle as its candidate for sheriff and that Mr. Besen was just a “placeholder”—until Mr. Boyle clinched the Republican nomination by winning the primary.

But Mr. Boyle didn’t win it. So the Suffolk Democratic Party replaced Mr. Besen with Errol Toulon of Lake Grove, for 22 years a uniformed officer in the New York City Department of Corrections, then its deputy commissioner, and later an assistant deputy Suffolk County executive for public safety under County Executive Steve Bellone.

If these political gyrations seem complex, that’s because they are. And they point to important issues in politics in Suffolk.

“Battle for decency in Suffolk politics,” was the headline of an editorial last month in Newsday. “Race for county sheriff illustrates how cross-endorsements corrupt the system,” was the sub-head.

The editorial began: “Round one is over. The people won,” referring to the victory of Mr. Zacarese in the primary. And then went into other elements. It spoke of how the anticipated Democratic endorsement of GOPer Boyle for sheriff was tied to a Democratic cross-endorsement deal with the Suffolk Conservative Party involving judgeships on the state Supreme Court here. It spoke of how Edward Walsh, formerly both Suffolk Conservative Party chairman and a corrections lieutenant in the Suffolk sheriff’s office, “was convicted of federal corruption charges on evidence supplied by current Sherriff Vincent DeMarco. Walsh, still pulling the party’s strings, jettisoned DeMarco for Boyle. Getting the Democratic line as well would greatly increase Boyle’s chances in November. That would mean that a man headed to federal prison would wind up determining who is Suffolk’s sheriff, who gets judgeships, and possibly who controls the State Senate, which has a one-vote GOP edge.”

Sheriff DeMarco is a Conservative who has run with Democratic support. Mr. Walsh was sentenced in June to two years in prison for wire fraud and theft of government services for receiving hundreds of thousands of dollars in his position in the Suffolk’s sheriff’s office while gambling, golfing and politicking when he was supposed to be working.

Because of a primary there’s a choice between two candidates for Suffolk sheriff with law enforcement qualifications to oversee the county’s jails in Riverside and Yaphank and supervise almost 900 corrections officers, 250 deputy sheriffs and 130 civilian personnel.

Mr. Zacarese says: “The duties and responsibilities of the sheriff are directly aligned with my experience and academic credentials I’ve been honing for the last 25 years.”

Mr. Toulon says: “I have spent decades working inside some of the toughest jails, guarding the toughest criminals, and I understand what it takes to keep our communities safe.” If he wins, he’d be the first African-American elected to a countywide governmental post in Suffolk.

Regarding history, a “High Sheriff” for East Riding (what is now Suffolk County) was first appointed by the colonial governor in 1683. In 1821, the post of Suffolk sheriff became elected, the situation in most counties in the United States. Neighboring Nassau, however, has a sheriff appointed by the county executive. In 2014, Mr. Bellone advanced the idea of the Suffolk sheriff also being appointed. It got nowhere. Having an elected sheriff, notes the website “Politics Stack Exchange,” allows voters “to determine…a changing of the guard.”