President Donald Trump has issued a series of controversial executive orders on immigration that are now tangled up in federal courts. Judges in Hawaii and Maryland have blocked the president’s ban on travelers from six mostly Muslim countries, and another judge in Seattle has blocked his executive order threatening to remove federal funding for “sanctuary cities” that refuse to cooperate with federal immigration agents.

If this contest between branches of government sounds familiar, it should. President Barack Obama also...