President Trump declares a national emergency at the U.S.-Mexico border as he speaks about border security in the Rose Garden of the White House Friday. (Carlos Barria/Reuters)

Congress and the president have averted a second government shutdown over funding for homeland security for the fiscal year that began in October. The deal delivers barely a quarter of the $5.7 billion President Trump wanted to build over 200 miles of concrete or steel walls along the southern border. Instead, Congress agreed to $1.375 billion for 55 miles of new fencing along the border — and included provisions that might eventually limit the administration’s ability to enforce its immigration policies.

Thwarted by Congress’s unwillingness to meet his funding demands, the president also declared a national emergency — intending to circumvent Congress’s power of the purse so that he can build the wall after all.

Here are three takeaways from the deal.

1. Leaders matter, even if they’re not at the table

Party leaders sent top members of the House and Senate appropriations committees into a room to resolve the stalemate over funding border security — but leaders themselves stayed away from those negotiations. As political scientist Richard Fenno, Jr. observed decades ago, House and Senate appropriations committees have a history of operating as well-integrated, bipartisan social enclaves. Such bipartisanship has been strained in today’s more partisan times, but some of it persists.

Certainly, the strong and long-standing relationship between the House panel’s two female leaders — Democrat Nita M. Lowey of New York and Republican Kay Granger of Texas — made it easier to come up with a deal. More generally, repeated interactions between seasoned sets of lawmakers who understand the top priorities of the other party — such as Senate appropriators Democrat Pat Leahy of Vermont and Republican Richard C. Shelby of Alabama — facilitate bargaining even in polarized times.

But even when party leaders aren’t in the room where the negotiating happens, they still have a powerful influence on bipartisan deals. Both parties’ appropriators almost certainly bargained within broad boundaries set by their respective party leaders, which affected both the type of barriers Democrats would support and the size of cuts Republicans would concede.

2. The shutdown blame game mattered

Negotiators reached a deal only after Democrats won the battle over who the public would blame for the recent government shutdown. Surveys showed that Americans largely blamed the president, not congressional Democrats — forcing President Trump to open up the government to meet Democrats’ precondition for bargaining over border security.

Sequence matters in congressional politics. Democrats’ win in the messaging war likely bolstered their leverage at the bargaining table. Senate GOP leader Mitch McConnell made clear that there is “no education in the second kick of a mule,” meaning that Republicans had a strong incentive to avoid another government shutdown. That meant Republicans would have to accept far less funding for border fencing and would have to accommodate Democrats’ unwillingness to fund a concrete or steel wall. But there’s a limit to leverage: Democrats were apparently unable to use Congress’s power of the purse to cap the number of detention beds available to house detainees away from the border.

3. Art of the deal? Not so much

The deal gives the president less money for border fencing than the GOP-led Senate appropriations panel offered in December. The agreement also stipulates that only existing fencing designs can be deployed. That means a border wall cannot be built from concrete as Trump relentlessly promised in his campaign. White House reporters called it the “most punishing defeat” of Trump’s presidency.

As political scientist George Tsebelis argued here at TMC during Trump’s first year in office, there’s a good reason that Trump’s “art of the deal” is particularly ill-suited for politics. Tsebelis noted that Trump’s negotiating protocol typically prioritized “take it or leave it offers.” That strategy assumes that negotiators can always turn to “outside options” — other bargaining partners — to make a different deal. In real estate, for example, Trump liked to keep several balls in the air “since most deals fall out.”

But there are no outside options when you negotiate with Congress. For the next two years, Trump will face the same central opponent: Democratic House Speaker Nancy Pelosi. Unfortunately for Trump, the Speaker has learned that the president typically takes unpopular positions — from repealing the Affordable Care Act to building a border wall — and then folds when the public, and sometimes his fellow elected Republicans, turn against him. The Speaker will have little incentive to give in if she anticipates that the president will always back down.

In declaring a national emergency, Trump likely thinks he’s discovered his coveted outside option to circumvent Congress’s power of the purse. But declaring a national emergency and asserting his executive authority to divert already appropriated moneys will likely face challenges in Congress and the courts.

Perhaps that’s why the president this week unfurled “Finish the Wall” banners at his latest campaign rally. Trump declared that construction of the wall was already well underway, a claim that fact-checkers judged to be “mostly false.” But so long as Democrats remain united against the president’s border wall, Trump’s rebranded campaign might be his only remaining outside option as his reelection effort gets underway.