Technically, the U.S. government could reopen for business, panda cam and all, before this article even earns a tweet. But the odds are against it. Neither party wanted this shutdown—because no one knew how it would play out. At the same time, both parties knew, deep down, that it had to happen—precisely, again, because no one knew how it would play out. The bases of both parties were too far apart on one of the most divisive issues in the country, that of immigration, to compromise, and each side suspected it had the upper hand. Sometimes, the only way to know if you’re going to win a war is to fight it.

A very quick summary: Democrats, and many Republicans, want to grant citizenship to about 3 million “Dreamers,” people who came to the United States illegally before they reached the age of 16. After negotiations with the White House over the Dreamers collapsed, all but five of the Democrats (joined by four Republicans) voted to block a Congressional Resolution to keep the government funded for several weeks more. Each side now blames the other. Democrats say that Donald Trump broke his word and allowed the White House to be hijacked by immigration hardliners. Republicans say that Democrats are holding government funding hostage to an issue unrelated to the budget.

Now we enter a public-relations campaign during which one side will start to lose ground, possibly right away, possibly only after a while. If things proceed as Democrats would like, a majority of Americans will start to blame Trump and the G.O.P. for this state of affairs, and Trump and the G.O.P. will agree to legalize most of the Dreamers with minimal concessions. If things proceed as many Republicans would like, a majority of Americans will blame Democrats for the trouble, government will get funded, and the parties will cut a deal to legalize a subset of the “Dreamers”—800,000 people who have been granted work permits under a program called Deferred Action for Childhood Arrivals, i.e. DACA—in exchange for a significant tightening of immigration law.

If anyone knew with a high degree of certainty who would emerge as the winner or loser, the showdown would not have proceeded past the brink to begin with, so firm predictions would be folly. Instead, let’s try to enter into the realities faced by each side.

On immigration, Republicans are a party severely divided, and the lines can be confusing. Some Republicans, such as Lindsey Graham, see almost no costs to immigration, legal or illegal, and feel, moreover, that the party must be friendly on the issue or face rejection in the future. Other Republicans, such as Tom Cotton, view unskilled immigration as a serious drag on the wages and welfare of low-skilled U.S. citizens and want to select newcomers primarily for skill rather than family ties. And most Republicans are for sale on the issue, torn between their base, which wants low immigration and high enforcement, and their donors, who want high immigration and low enforcement. Distrust of these Republicans, a large number of whom voted for a comprehensive legalization of all immigrants in 2013, more than anything else, accounted for Trump’s rise.

With such divides, the Republican negotiating position was already going to be messy. But then there was Donald Trump. During his campaign, Trump vowed to rescind DACA. After he took office, he kept the program going. Then, last September, he indicated that he supported a no-conditions-attached legalization for DACA recipients. Then the White House followed up by issuing a much tougher set of demands to be met in exchange for granting citizenship to DACA recipients. Then, less than two weeks ago, Trump indicated he’d sign any immigration bill that made it to his desk. Then the White House reversed course, and Trump also spurned a bipartisan deal presented by Dick Durbin and Lindsey Graham (this was the infamous “shithole” meeting.) Whether you attribute these shifts to incompetence or four-dimensional chess says a lot about whether you’d be fit to stand trial for murder in a U.S. courtroom.