Xavier Becerra, California’s attorney general, has said that his attitude is slightly different. “We don’t wake up in the morning looking to pick a fight with the Trump administration,” he said. “But we will do what is necessary to defend our values.”

Texas sued the Obama administration at least 48 times, according to a survey conducted by The Texas Tribune. The Trump administration is a little more than a year old, and California is already within striking distance of those numbers.

California has been doing well in court, winning more than a dozen rulings against the administration. Many of those victories came from federal judges in the state, and Mr. Sessions may have been referring to them when he complained about “ideological judging.”

The state is also likely to receive receptive hearings when its cases reach the United States Court of Appeals for the Ninth Circuit, in San Francisco, which has been a frequent target of Mr. Trump’s criticism. The Supreme Court is a more attractive forum from the administration’s perspective, but the justices agree to hear very few cases.

The lawsuits all have distinct features, but collectively they pose fascinating questions about the Constitution’s allocation of power between the federal government and the states. They also give rise to a teachable moment in legal opportunism.

“Blue states and blue cities are making arguments about limited federal power that are traditionally associated with the political right,” Professor Somin said. “On the other hand, the Trump administration is staking out a very broad position on federal power.”