Donald Trump’s greatest skill as a businessman is using the courts to turn failure into success. He has led companies into bankruptcies six times, losing billions of dollars of other people’s money — while enriching himself through court-mediated settlements.

His campaign to overturn the election results comes from the same playbook. With unlimited legal advice paid for by donations — again, using other people’s money for his personal ends — he will try every legal gambit possible until the clock runs out.

Trump literally has nothing to lose. He knows he has lost the election, so anything he gets in the courts is upside.

And even if he gets nothing substantial from the legal system, which is certain, at least he can soothe his humiliation at being fired, by crippling President-elect Joe Biden’s efforts to mount a smooth transition.

But Trump’s biggest aim in the legal charades playing out in courtrooms all across the country is to convince his base that he has been stabbed in the back by a rigged election.

These resentful loyalists are his future capital. In the short term, he may use them to keep a visible presence on the political stage. In the longer term, if he can keep them energized, he may use them as the foundation for another run at the White House in 2024.

In the meantime, he may keep selling them “merch” — he has, after all, personally guaranteed more than $400 million in debt coming due soon. If you’ve already got the MAGA hat, how about the T-shirt or sweatpants?

The real loser in all this — the equivalent of Trump’s fleeced investors in his real estate fiascos — is the American people and our democratic system.

Trump knows that to succeed personally, he will have to delegitimize the democracy that repudiated him. He can only regain power — or even maintain relevance — by stoking rage against the system.

His politics have always been based on resentment and willful ignorance, but now that he will no longer lead the Republican Party after his defeat he will have to build a “Party of Trump” that creates its own logic of injustice and dispossession.

Some fear that Trump’s frantic legal campaign is a prelude to a coup d’etat, or an attempt to replay Bush v. Gore, which will end in his redemption by a conservative majority Supreme Court.

But that is giving Trump too much credit. As always, Trump’s motivations are transparent, his strategy simple.

Trump is a showman, and he lives for the roar of an appreciative audience. His behavior, now and always, is calibrated to generate adulation only, not policy results or tangible accomplishments.

His politics change as often as his businesses fail. He will do and say whatever it takes to stay in the public eye.

Trump’s lawsuits to nullify the election are just Trump being Trump — the consummate salesman whose only product is himself.