A secretive super-court system called ISDS is threatening to blow up President Barack Obama’s highest foreign policy priority.

Investor-state dispute settlement — an integral part of the Trans-Pacific Partnership trade deal — allows companies to sue entire countries for costing them money when laws or regulations change. Cases are decided by extrajudicial tribunals composed of three corporate lawyers. Buzzfeed, in a multi-part investigation launched Sunday, called it “the court that rules the world.”

Although the ISDS process has existed for years, TPP would drastically expand it. The most common criticisms of the system are that it’s secret, that it’s dominated by unaccountable big-firm lawyers, and that global corporations use it to change sovereign laws and undermine regulations. That’s all true.

But here’s what most of the coverage and the critics are missing.

The ISDS system â€• which is now written into over 3,000 international trade treaties, including NAFTA â€• was designed to solve a specific problem. When corporations invest abroad, they fear that their factories might be nationalized or their products expropriated by governments that also control the local courts. ISDS is meant to give companies confidence that if a country seizes their accounts or factories, they’ll have a fair, neutral place to appeal.

But instead of helping companies resolve legitimate disputes over seized assets, ISDS has increasingly become a way for rich investors to make money by speculating on lawsuits, winning huge awards and forcing taxpayers to foot the bill.

Here’s how it works: Wealthy financiers with idle cash have purchased companies that are well placed to bring an ISDS claim, seemingly for the sole purpose of using that claim to make a buck. Sometimes, they set up shell corporations to create the plaintiffs to bring ISDS cases. And some hedge funds and private equity firms bankroll ISDS cases as third parties — just like billionaire Peter Thiel bankrolled Hulk Hogan in his lawsuit against Gawker Media.

It’s the same playbook that hedge funds were following when they bought up Argentine, Puerto Rican and other U.S. housing debt for pennies on the dollar. As The Huffington Post reported in May, the financiers were betting they could use lawsuits and lobbying to influence the political system in favor of the creditors like them and reap huge rewards.

Indeed, the damage of ISDS goes far beyond the money that investors manage to extract from public coffers and extends to the corruption of a political system by investors who buy off scholars, economists and politicians in pursuit of whatever policy outcome leads to a payoff. And there’s nothing stopping plutocrats with agendas that go beyond profit-making from getting involved â€• again the way Thiel did with Gawker. That alone changes the power dynamic: If you’re the government of Thailand, the billionaire you’re negotiating with has one extra threat at his disposal.

If these investors are able to cement ISDS as part of the Trans-Pacific Partnership, the opportunities for hedge funds to do what they’ve already done to Argentina will be endless â€• possibly even in cities and states under financial pressure in the U.S., like Detroit and Illinois.

So-called third-party funding of “international arbitration against foreign sovereigns” has been expanding quickly, according to Selvyn Seidel, a pioneer in the litigation finance industry and now CEO of the advisory firm Fulbrook Capital Management.

“You can get an award for billions of dollars when that award would never come out in domestic law,” said Gus van Harten, a professor at Osgoode Hall Law School at York University in Toronto. “It’s just a jackpot for speculators.”