After a shutdown that lasted nearly three full days, Congress voted to reopen the federal government on Monday afternoon.

It was the first government shutdown of the Trump administration — and it may not be the last. The new law funds the government only for the next two and a half weeks, through February 8.

So though Democrats and Republicans have come to an agreement for the short term, it’s worth taking stock of why, exactly, this shutdown happened, and why it matters. Because that information could come in handy again soon.

1) Why did the government shut down?

The most basic reason is that the government gets funded by laws that have to go through Congress — and this time, Congress failed to pass a new government funding law before the old one expired. Hence, the shutdown.

The more fundamental reason, though, is that a long-simmering dispute between Democrats and Republicans over immigration has finally boiled over.

Democrats are trying to take a stand and force Republican leaders to make a deal giving deportation protections to hundreds of thousands of unauthorized immigrants who were brought to the US as children. These are the DACA (Deferred Action for Childhood Arrival) program recipients, commonly referred to as DREAMers.

The Trump administration decided to end this program, which would leave these young immigrants, many of whom grew up thinking of themselves as Americans, without legal protections. (Though the administration originally said it would sunset the program on March 5, a recent court ruling has led them to partially restart it for now.)

Until they see some progress on a deal protecting DACA recipients, most Democrats said they’d withhold their support from government funding bills. Since these bills need a 60-vote supermajority, and therefore at least nine Democratic votes, to pass the Senate, this caused the government shutdown.

2) What is a government shutdown, exactly?

While a government shutdown is indeed a major event, it’s not quite as dramatic as it sounds — the entire federal government certainly doesn’t shut down. Military and law enforcement activities continue. Social Security checks still go out. Air traffic controllers still go to work.

However, activities the government has deemed “nonessential” stop, and employees tasked with those activities are furloughed — they’re told not to come to work, and that they won’t be paid until the shutdown is resolved. For the last shutdown, in 2013, this “nonessential” group totaled about 40 percent of federal nonmilitary employees.

Basically, it’s a tremendous inconvenience for millions of Americans and certainly has the potential to lead to even more serious problems the longer it stretches.

3) Has the government shut down before?

The government has actually shut down 18 times in modern history before this one, but the shutdowns that loom the largest in recent memory occurred under Presidents Bill Clinton (twice) and Barack Obama. In both administrations, Republicans in Congress attempted to get a Democratic president to sign on to conservative policy demands in exchange for funding the government. In both, the president refused, leading to shutdowns. And in both, the president was viewed as the eventual “winner,” eventually getting Congress to agree to reopen the government with relatively minor if any concessions.

4) What is DACA, and why is it so important to all this?

The chain reaction that eventually led to this shutdown began back in September, when the Trump administration announced it would end the DACA program — and also called on Congress to pass a law reinstating it.

This program, which President Obama established in 2012, granted work permits and deportation protections to hundreds of thousands of unauthorized immigrants who came to the US as minors and who had been in the country for several years (often called DREAMers). However, Republicans have long said Obama didn’t have the legal authority to set up the program without Congress, and the Trump administration cited this as its justification for ending it. Attorney General Jeff Sessions made this announcement in September, with the goal of sunsetting the program entirely by March.

But Trump was evidently hesitant to endorse ending DACA outright. The DREAMers have long been considered the most politically sympathetic group of unauthorized immigrants. They’re young, they came here through no fault of their own, and many were largely raised here. The Trump administration’s decision would put them at risk of deportation when their work permits expired.

So Trump said that Congress should act to “legalize” DACA by March — putting the perennially controversial issue of immigration at the top of their 2018 agenda. One possible motivation for this is that he hoped to avoid political blame for ending DACA. But another is that he essentially hoped to hold DACA recipients hostage to win concessions from Democrats on some “tough” immigration measures.

5) But how did immigration get tied to the government shutdown?

For months, immigration and other progressive activists have been arguing that Democrats needed to fight harder to help DACA recipients. And one obvious point of potential leverage over Republicans is that Democratic votes are needed to fund the government. So these activists argued that Democrats shouldn’t vote for any government funding bill without a DACA deal.

Still, for some time, Democratic leaders preferred to pursue negotiations with Trump separately. After all, they thought, Trump had outright called for Congress to legalize DACA, which would seem to suggest he wants to get to yes. And Democrats and several Senate Republicans put together a bipartisan deal.

Earlier this month, however, the talks took a disastrous turn. A bipartisan group of pro-immigration members of Congress headed to the White House to meet Trump on January 11 — and were surprised to see that some of Congress’s furthest-right immigration hardliners had also been invited. Things went from bad to worse when Trump reportedly complained that the US is letting in too many immigrants from “shithole countries” (though his defenders claim he said the word “shithouse”).

All along, a deal that could get Trump’s approval has remained elusive. Whether that’s because of the president’s own hawkish instincts and views on immigration, or because he’s too beholden to his hardline advisers and his “base” voters, isn’t clear. Mitch McConnell and Paul Ryan, Republicans’ congressional leaders, have been similarly difficult to pin down.

Finally, frustrated Democrats in Congress concluded that Republicans won’t get serious on the matter unless their hand is forced. So most of the party’s congressional wing finally came to agree with their activists that they shouldn’t vote to fund the government until Republicans get serious on DACA. And on Friday, they made good on their threat.

Now, the Republican interpretation of events is that the GOP put forward a perfectly reasonable government funding bill that simply didn’t address the separate issue of immigration — and that Democrats chose to block the bill and shut down the government over this “unrelated issue,” one on which negotiations are still continuing.

6) What happened after the government shut down?

Both Democrats and Republicans talked tough as the shutdown began Saturday — and each party sought to blame the other for what happened. All along, though, both sides had political reasons to be queasy about keeping the government shut down for too long.

The Democratic worry was that keeping the government shut down on behalf of unauthorized immigrants — even the DREAMers — is a political loser. Furthermore, many Democratic senators are facing tough reelections in red states this year and fear being tagged as extremists. Meanwhile, Republicans worry that since Trump is president and their party controls Congress, they’ll be blamed for the shutdown and deemed incompetent.

Now, a shutdown over the weekend wasn’t seen as an enormous deal, since the vast majority of furloughed federal workers wouldn’t work during the weekend anyway. But extending a shutdown through the workweek — the week before President Trump’s State of the Union address, no less — would be much more painful.

So on Sunday night, Senate Majority Leader Mitch McConnell publicly made an offer to continue government funding for two and a half more weeks — adding that if no deal on DACA is reached before then, it’s his intention to bring up an immigration bill after that.

And on Monday midday, Schumer announced that he and Democrats would take this offer and reopen the government. A bill to do so then passed through both houses of Congress, and got Trump’s signature.

7) What’s next?

Democrats, naturally, had some questions and concerns about McConnell’s promise for a vote on a DACA bill.

What bill, exactly, would McConnell bring up? Would he even bring one up at all? When would the vote be? And won’t this all be for naught unless the House of Representatives and President Trump also sign on?

However, the party appears to have calculated that this is the best it could hope for, and agreed to reopen the government. Republicans gleefully declared victory, and many pundits concluded they were right to do so.

Democrats have managed to accede to Republican demands, demoralize their energized base, give a disengaged president a win, and look like they held a meaningless three day government shutdown — all at once. — Matt Viser (@mviser) January 22, 2018

Democrats, however, say that their efforts shouldn’t be judged a failure until we see what the next few weeks of negotiations over DACA result in — and that will take some time.

And now that McConnell’s bill reopening the government has passed, it sets us up for the next crisis — after February 8, when the government is scheduled to shut down again.