Midterm elections have long been understood as a referendum on the incumbent president. In our era of bad feelings, they have tended to shift Congress away from that president’s party. That means the Democrats are likely to gain control of at least one chamber in this fall’s contests.

Republicans in Washington seem almost resigned to this outcome. And they’ve persuaded themselves that it won’t mean much because the president is not trying to get any significant legislation through Congress anyway, so losing control of the legislative branch won’t really narrow his options.

The president has stated this premise remarkably openly. “In theory we’ve gotten everything passed that we need,” Trump said in a February interview with Larry Kudlow on Fox Business Network. “Now we just need to manage it. But we’ve gotten everything passed that we need for four years.” He is not even pretending to have a legislative agenda for the rest of his presidency.

At first glance, this might indeed seem to reduce the stakes of the midterms. If Trump is not looking for any legislative gains in the remainder of his term, then he has little to lose if the Democrats take the House or Senate. But that is not how the logic of legislative negotiations actually works. In fact, because he lacks an agenda, and therefore has nothing to gain from Congress, Trump has more to lose if his party loses its majorities.

A Democratic Congress would have serious leverage over a Republican president. Normally, that means the president should expect to get less of his favored legislation through or to make deeper concessions if he wants any gains. But if Trump’s stated goal is nothing, then he can only lose ground, and he will.

This is easy to miss because we have become overly persuaded of a cliché about Congress that is mostly but not entirely true. We think that the legislative branch has stopped functioning altogether — that it has utterly surrendered its role in the constitutional system and turned itself into a circus of clowns. Though largely accurate, this assumption overlooks a kind of annual Washington miracle.

The appropriations process, by which Congress approves spending levels for nearly every federal program, requires bipartisan cooperation, especially in the Senate. Although it never goes smoothly, and now often involves extended government shutdowns and continuing resolutions that avoid substantively detailed legislative bargains, it does get done every single year.

That means that in Trump’s last two years in office, Congress will almost certainly make at least two multitrillion-dollar bipartisan legislative deals. If Democrats control one or both chambers when those deals are made, they will have significant influence over what is on the table. And if the Trump administration has little or nothing to demand in that process, the resulting negotiations will largely concern how much the Democrats can secure of what they ask for.

Of course, the Democrats don’t exactly have a full slate of policy ambitions either. And they won’t advance a comprehensive agenda of their own while Trump is president. But they will be able to undo some of his priorities and to advance some of their own goals that are popular with voters but not with Republicans in Washington. In other words, the president will have a lot to lose and little to gain from the appropriations process.

The White House is clearly aware of this, because it is acting to contain the damage in the one governing domain in which the president’s key policy advisers have actual priorities: immigration enforcement. It is important to recognize just how unusual — indeed unprecedented — the Republican approach to immigration funding has become, and what an admission of weakness it is. Congressional Republicans have pursued a reconciliation bill in the last few months to advance some partisan spending priorities without the threat of a Senate filibuster while they still control Congress. And they have chosen to use that opportunity to pre-fund two Department of Homeland Security agencies — Immigration and Customs Enforcement (ICE) and Customs and Border Protection (CBP) — for the remainder of Trump’s presidency.

Republicans know that congressional Democrats will not fund those two agencies at anywhere near the levels the Trump administration wants if they win control of one or both chambers. So they have worked to advance a reconciliation bill that would ensure that ICE and CBP will not need to be funded by normal appropriations at all for the next two years. But by using reconciliation this way, congressional Republicans are implicitly acknowledging that everything else could also be leveraged by a Democratic Congress.

Some Republican legislators insist that they will follow this reconciliation bill with yet another before the next Congress begins. They hope to use that bill to pre-fund a major defense-spending increase for the coming years and take care of some other priorities. It is far from clear that they can get another reconciliation bill done before January. But even if they do, much of the budget will remain subject to the normal appropriations process, in the course of which the Democrats could demand lots of concessions — including reductions in defense and immigration spending.

By using reconciliation this year to pre-fund a few priorities, Republicans are working to make the status quo more tolerable for themselves next year. In turn, they are making flat continuing resolutions more appealing as an easy out in future shutdown fights. But last year’s extended shutdown showed that Republicans are far from immune to blame and political cost when the government isn’t funded. If they enter a budget showdown next year with nothing to gain, then the best they can hope for is to contain their losses.

The GOP is not in this situation because it is uniquely unpopular, or even because its prospects in the midterms are unusually grave, but because neither the Trump administration nor congressional Republicans have any particular policy ambitions at this point. They are adrift.

The president clearly enjoys using his power ad hoc — to make threats, exact retribution, push institutions around, intimidate friends and foes at home and abroad, and dominate the news cycle. He could well invade Cuba in his last two years in office or demand that Harvard change its name to Trump University. But he won’t do so as part of any sustained and organized strategy. He’ll wield his power as a cudgel day to day.

He thinks this approach to his office is a mark of strength. But if the Democrats take control of Congress, he will find that the policy vacuum he has created is in fact a source of weakness and a threat to what his administration has accomplished or might want to achieve.

Choosing not to govern through the structure of our system of government leaves the president vulnerable. When all is said and done, the logic of the Constitution will likely have the last laugh.