For law enforcement, Congress and even journalists, exposing misdeeds is like peeling an onion. Each layer you remove gets you closer to the truth.

So it is with the scandalous behavior of the FBI during its probe into whether President Trump’s campaign conspired with Russia in 2016. One layer at a time, we’re learning how flawed and dirty that probe was.

A top layer involves the texts between FBI lawyer Lisa Page and her married lover, Peter Strzok, the lead agent on the Hillary Clinton e-mail probe. They casually mention an “insurance policy” in the event Trump won the election and a plan for Strzok to go easy on Clinton because she probably would be their next boss.

Those exchanges, seen in the light of subsequent events, lead to a reasonable conclusion that the fix was in among then-Director James Comey’s team to hurt Trump and help Clinton.

Another layer involves the declassified House memo, which indicates the FBI and Justice Department depended heavily on the unverified Russian dossier about Trump to get a warrant to spy on Carter Page, an American citizen and briefly a Trump adviser.

The House memo also reveals that Comey and others withheld from the secret surveillance court key partisan facts that would have cast doubt on the dossier. Officials never revealed to the judges that the document was paid for by Clinton’s campaign and the Democratic National Committee or that Christopher Steele, the former British spy who compiled the dossier, said he was “desperate that Donald Trump not get elected.”

For Clinton, creating a cloud over Trump’s presidency and helping to put the nation through continuing turmoil is a victory of sorts. America is fortunate it’s her only victory.

A third layer of the onion involves the revelations in the letter GOP Sens. Charles Grassley and Lindsey Graham wrote to the Justice Department. They urge a criminal investigation into whether Steele lied to the FBI about how much and when he fed the dossier to the anti-Trump media.

The letter is compelling in showing that Steele said one thing under oath to a British court and something different to the FBI. The contradictions matter because the agency relied on Steele’s credibility in both the FISA applications and its actual investigation. Strangely, even after it fired him for breaking its rule forbidding media contact, the FBI continued to praise his credibility in court.

If that were all the senators’ letter accomplished, it would be enough. But it does much more.

It also reveals that two former journalists linked to Clinton, separately identified as the odious Sidney Blumenthal and a man named Cody Shearer, created and gave a State Department official additional unverified allegations against Trump.

The official passed those documents to Steele, who passed them to the FBI, which reportedly saw them as further evidence that Trump worked with Russians. But as Grassley, head of the Judiciary Committee, and Graham write, “It is troubling enough that the Clinton Campaign funded Mr. Steele’s work, but that these Clinton associates were contemporaneously feeding Mr. Steele allegations raises additional concerns about his credibility.”

The State Department official involved in the episode, Jonathan Winer, wrote an Op-Ed in the Washington Post Friday in which he confessed to the senators’ chronology while offering a benign description of his motives. Winer also admitted he shared all the unverified allegations from the Clinton hitmen with other State Department officials.

There are many more layers of the onion to peel, but here’s where we are now: It increasingly appears that the Clinton machine was the secret, original source of virtually all the allegations about Trump and Russia that led to the FBI investigation.

In addition, the campaign and its associates, including Steele, were behind the explosion of anonymously sourced media reports during the fall of 2016 about that investigation.

Thus, the Democratic nominee paid for and created allegations against her Republican opponent, gave them to law enforcement, then tipped friendly media to the investigation. And it is almost certain FBI agents supporting Clinton were among the anonymous sources.

In fact, the Clinton connections are so fundamental that there probably would not have been an FBI investigation without her involvement.

That makes hers a brazen work of political genius — and perhaps the dirtiest dirty trick ever played in presidential history. Following her manipulation of the party operation to thwart Bernie Sanders in the primary, Clinton is revealed as relentlessly ruthless in her quest to be president.

The only thing that went wrong is that she lost the election. And based on what we know now, her claims about Trump were false.

Of the charges against four men brought by special counsel Robert Mueller, none involves helping Russia interfere with the election.

And neither the FBI nor Mueller has vouched for the truthfulness of the Blumenthal and Shearer claims or the Steele dossier. ­Instead, the dossier faces defamation lawsuits in the US and England from several people named in it.

In fairness, one person besides Steele has been cited as justification for the FBI probe. George Papadopoulos, a bit but ambitious player in the Trump orbit, met with a professor in Europe early in 2016 who told him the Kremlin had Clinton’s private e-mails.

In May 2016, Papadopoulos told the story to an Australian diplomat and two months later, in July, the Australian government alerted the FBI.

However, a full timeline convincingly points to Steele as the initial spark. He was hired by a Clinton contractor in June of 2016, and filed his first allegations against Trump on June 20. Two weeks later, on July 5, he met with an FBI agent in London, The Washington Post reported, and filed three more allegations that month, including one about Carter Page.

At any rate, it is certain that Steele and other Clinton operators provided all the allegations about Trump himself that the FBI started with and that Mueller inherited.

For Clinton, creating a cloud over Trump’s presidency and helping to put the nation through continuing turmoil is a victory of sorts. America is fortunate it’s her only victory.

To read more Michael Goodwin on The New York Post click here.