As the criminal indictments of Donald Trump continue to pile up like boxes in a Mar-a-Lago bathroom, the former president’s defenders have settled on a response: They don’t claim their man is innocent of the scores of federal and state charges against him — a tough case to make under the circumstances. Instead they accuse the Biden administration and Democratic prosecutors of politicizing law enforcement and cooking up an insurance policy to protect President Biden, who trails Mr. Trump in some polls about a very possible 2024 rematch.

“So what do they do now?” House Speaker Kevin McCarthy asked last week, after Mr. Trump announced that he had received a second target letter from the special counsel Jack Smith, this time over his role in the Jan. 6 attack. “Weaponize government to go after their No. 1 opponent.”

Gov. Ron DeSantis, one of the few plausible Republican nominees besides Mr. Trump, warned that the government is “criminalizing political differences.”

It’s not only about Mr. Trump; griping about politicized law enforcement has become a cottage industry on the right these days. No sooner did Republicans take back the House of Representatives than they formed a Select Subcommittee on the Weaponization of the Federal Government, which meets regularly to air grievances and grill witnesses about their supposed anti-conservative animus, including Christopher Wray, the (Trump-nominated) F.B.I. director.

If you’re feeling bewildered by all the claims and counterclaims of politicization, you’re not alone. Take the F.B.I.’s probe of ties between Russia and the 2016 Trump campaign, which is still being hashed out in the halls of Congress seven years later: In February, Democratic lawmakers demanded an investigation of the investigators who investigated the investigators who were previously investigated for their investigation of a transnational plot to interfere in a presidential election. Got that?

But even if the charge of politicized justice is levied by a bad-faith buffoon like Representative Jim Jordan of Ohio, the chairman of the weaponization subcommittee, it is a profoundly important one. There is no simple way to separate politics completely from law enforcement. The Justice Department will always be led by a political appointee, and most state and local prosecutors are elected. If Americans are going to have faith in the fairness of their justice system, every effort must be taken to assure the public that political motives are not infecting prosecutors’ charging decisions. That means extremely clear rules for investigators and prosecutors and eternal vigilance for the rest of us.

At the same time, politically powerful people must be held to the same rules as everyone else, even if they happen to be of a different party from those investigating them. So how to distinguish an investigation or prosecution based solely on the facts from one motivated improperly by politics?

Sometimes the investigators make it easy by just coming out and admitting that it’s really political. Mr. McCarthy did that in 2015, when he bragged on Fox News that the House Benghazi hearings had knocked a seemingly “unbeatable” Hillary Clinton down in the polls. More recently, James Comer of Kentucky, who heads the House committee that is relentlessly investigating Hunter Biden, made a similar argument about the effect of the committee’s work on President Biden’s political fortunes. (Mr. Comer tried to walk back his comment a day later.)

More often, though, it takes some work to determine whether an investigation or prosecution is on the level.

The key thing to remember is that even if the subject is a politically powerful person or the outcome of a trial could have a political impact, that doesn’t necessarily mean the action itself is political. To assume otherwise is to “immunize all high-ranking powerful political people from ever being held accountable for the wrongful things they do,” said Kristy Parker, a lawyer with the advocacy group Protect Democracy. “And if you do that, you subvert the idea that this is a rule-of-law society where everybody is subject to equal justice, and at the same time you remove from the public the ability to impose any accountability for misconduct, which enables it to happen again.”

In May, Protect Democracy published a very useful report, co-written by Ms. Parker, laying out several factors that help the public assess whether a prosecution is political.

First, what is the case about? Is there straightforward evidence of criminal behavior by a politician? Have people who are not powerful politicians been prosecuted in the past for similar behavior?

Second, what are top law-enforcement officials saying? Is the president respecting due process, or is he demanding investigations or prosecutions of specific people? Is he keeping his distance from the case, or is he publicly attacking prosecutors, judges and jurors? Is the attorney general staying quiet, or is he offering public opinions on the guilt of the accused?

Third, is the Justice Department following its internal procedures and guidelines for walling off political interference? Most of these guidelines arose in the aftermath of the Watergate scandal, during which President Richard Nixon ordered the department to go after his political enemies and later obstructed the investigation into his own behavior. Until recently, the guidelines were observed by presidents and attorneys general of both parties.

Finally, how have other institutions responded? Did judges and juries follow proper procedure in the case, and did they agree that the defendant was guilty? Did an agency’s inspector general find any wrongdoing by investigators or prosecutors?

None of these factors are decisive by themselves. An investigation might take a novel legal approach; an honest case may still lose in court. But considering them together makes it easier to identify when law enforcement has been weaponized for political ends.

To see how it works in practice, let’s take a closer look at two recent examples: first, the federal investigations into Mr. Trump’s withholding of classified documents and his attempts to overturn the 2020 election and, second, the investigation by John Durham into the F.B.I.’s Russia probe.

In the first example, the Justice Department and the F.B.I., under Attorney General Merrick Garland, waited more than a year to pursue an investigation of Mr. Trump’s role in the Jan. 6 attack with any urgency — largely out of the fear that they would be seen as politically motivated.

With a punctiliousness that has exasperated many liberals, Mr. Garland has kept his mouth shut about Mr. Smith’s prosecutions, except to say that the department would pursue anyone responsible for the Jan. 6 attack. Mr. Garland almost never mentions Mr. Trump by name. And Mr. Smith has been silent outside of the news conference he held last month to announce the charges in the documents case.

In that case, Mr. Smith presented a tower of evidence that Mr. Trump violated multiple federal laws. There are also many examples of nonpowerful people — say, Reality Winner — who were prosecuted, convicted and sentenced to years in prison for leaking a single classified document. Mr. Trump kept dozens. Even a federal judge who was earlier accused of being too accommodating to Mr. Trump has effectively signaled the documents case is legitimate, setting a trial date for May and refusing the Trump team’s demand to delay it until after the 2024 election.

In the Jan. 6 case, the government has already won convictions against hundreds of people for their roles in the Capitol attack, many involving some of the same laws identified in Mr. Smith’s latest target letter to Mr. Trump.

“Prosecutors will hear all sorts of allegations that it’s all political, that it will damage the republic for all of history,” Ms. Parker, who previously worked as a federal prosecutor, told me. “But they have to charge through that if what they’ve got is a case that on the facts and law would be brought against anybody else.”

President Biden’s behavior has been more of a mixed bag. He and his advisers are keen to advertise his disciplined silence about Mr. Trump’s legal travails. “I have never once — not one single time — suggested to the Justice Department what they should do or not do,” he said in June. Yet he has commented publicly and inappropriately on both investigations over the years.

It’s impossible to justify these remarks, but it is possible to consider them in light of the other factors above and to decide that Mr. Smith’s investigations are not infected with a political motive.

Contrast that with the investigation by John Durham, the federal prosecutor appointed by Mr. Trump’s attorney general Bill Barr in 2019 to investigate the origins of the F.B.I.’s Trump-Russia probe.

Even before it began, the Durham investigation was suffused with clear political bias. Mr. Trump had repeatedly attacked the F.B.I. over its handling of the Russia probe and called for an investigation, breaching the traditional separation between the White House and the Justice Department. Mr. Barr had also spoken publicly in ways that seemed to prejudge the outcome of any investigation and inserted himself into an investigation focused on absolving Mr. Trump of wrongdoing.

Not every investigation or prosecution will offer such clear-cut evidence of the presence or absence of political motivations. But as with everything relating to Mr. Trump, one generally doesn’t have to look far to find his pursuit of vengeance; he has taken to describing himself as the “retribution” of his followers. If he wins, he has promised to obliterate the Justice Department’s independence from the presidency and “go after” Mr. Biden and “the entire Biden crime family.”

For the moment, at least, Mr. Trump is not the prosecutor but the prosecuted. And there should be no fear of pursuing the cases against him — especially those pertaining to his attempts to overturn his loss in 2020 — wherever they lead.

“If we can’t bring those kinds of cases just because the person is politically powerful, how do we say we have a democracy?” asked Ms. Parker. “Because in that case we have people who are above the law, and they are so far above the law that they can destroy the central feature of democracy, which is elections, in which the people choose their leaders.”