Oral argument before the lower courts took place in the first week in December; the Fourth Circuit has not released its decision, but on Friday, the Ninth Circuit affirmed the trial court’s decision striking down the ban.

Let’s start with what the Ninth Circuit opinion isn’t—it is not a judgment that the administration’s latest order is a “Muslim ban.” It is not based on President’s Trump’s bigoted rhetoric, either as a candidate or after taking office. It does not find that the ban covertly discriminates by religion. It does not second-guess the executive’s factual decisions about national security. And it is not a challenge to the basic doctrine of immigration law—that Congress has “plenary power” to limit immigration on any basis it chooses.

In effect, the opinion turns the government’s claim of sweeping power back on itself. It assumes the government does have sweeping power to exclude aliens: “The Constitution gives Congress primary, if not exclusive, power to set immigration policy.” That may even include the power to discriminate by religion, nationality, or race. But even if that power exists, the president can’t just grab it by executive order. For that reason, courts must assess whether any presidential action conforms to “the [Immigration and Nationality Act]’s finely reticulated regulatory scheme.”

The government’s argument is that one section of the Act, § 1182(f), gives the president virtually unlimited authority to ban any group of immigrants:

Whenever the President finds that the entry of any aliens or of any class of aliens into the United States would be detrimental to the interests of the United States, he may ... for such period as he shall deem necessary, suspend the entry of all aliens or any class of aliens as immigrants or nonimmigrants, or impose on the entry of aliens any restrictions he may deem to be appropriate.

The court does not question the statute, but it denies that the Travel Bans conform to it: first, it argues, the president did not make any legally significant “finding” that the entry of travelers under 3.0 would be “detrimental” to U.S. interests; second, Trump did not “suspend” entry, but imposed an indefinite ban; third, Trump issued the ban to circumvent, not implement, the system of terrorist screening Congress had dictated; and, fourth, Congress in a separate statute has explicitly forbidden the executive to discriminate (in issuing immigrant visas at least) on the basis on nationality.

Here is the heart of the argument. The court reasons that Congress, elsewhere in § 1182, set out permitted ways for the executive to exclude possible terrorists and protect the U.S. when foreign countries don't provide information the U.S. needs to screen applicants. The statute provides nine different specific security-related grounds for exclusion, including a provision barring an alien “who has engaged in a terrorist activity.” The statute also has sections governing countries that don’t share information needed to assess visa applications. These provisions are the choices Congress made in this area. It would make little sense, the opinion suggests, to read 1182(f) as wiping them out by giving the president the power to suspend entry of any immigrants anywhere anytime because—well— because terrorism is bad or information is good.

[T]he President cannot effectively abrogate existing immigration law while purporting to merely strengthen it; the cure cannot be worse than the disease. Here, the President has ... overridden Congress’s legislative responses to the same concerns the Proclamation aims to address. The Executive cannot without assent of Congress supplant its statutory scheme with one stroke of a presidential pen.

In other words, Congress has the power to rewrite the law; Donald Trump does not. That is the basic rule called “separation of powers.” The opinion cites an earlier Supreme Court opinion—by potential swing vote Anthony Kennedy—that the separation must be observed “even when the executive actions respond to ... issues that potentially place the country’s ‘Constitution and its survival in peril’” because “’[c]oncentration of power in the hands of a single branch is a threat to liberty.’”