Congress has passed and the president will soon sign into law nearly a trillion dollars of pandemic relief for families, businesses, hospitals and others hit hard by the economic devastation wrought by covid-19. The deal comes nearly nine months after Congress passed the $2 trillion Cares Act. Most economists say that the new law does not provide nearly enough aid to repair the economic damage caused by the pandemic.

Why did Congress finally make a deal? The November elections scrambled the players and shifted their priorities. Covid-19 cases and deaths have been sharply rising in both red and blue states, and the recovery has been stalling. Impending Senate contests in Georgia pulled Republicans off the sidelines, and President-elect Joe Biden pushed Democrats to accept a far more limited deal.

Here’s what you need to know.

Gambling before the election

Upcoming presidential elections sometimes catalyze action: Both parties want to show they can be trusted to govern. For instance, in 2015 and 2016, with the presidential election looming, the GOP-led Congress selectively cooperated with Democrats to act on long-stalled education program reforms, Medicare finances, highway construction and more. Other times, one or both parties might want not a law but an unresolved issue to inspire voters to turn out. In those cases, impending elections breed stalemate, as happened before the 1992 election, when scores of top-priority bills — on everything from health care to tax cuts and deficits — went nowhere.

This time, even as the pandemic worsened throughout the summer and fall, Republicans dismissed the HEROES Act, a $3 trillion package that the Democratic-led House passed last May. Senate Majority Leader Mitch McConnell (R-Ky.) refused to negotiate with Democrats, in part because the Senate GOP and the Trump White House differed over whether to advance more aid. To try to bridge the gap, House Democrats cut their proposal by a third, negotiated with President Trump’s Treasury Secretary Steven Mnuchin, and waited in vain for Senate Republicans to come to the bargaining table. In September, Republicans countered by trying and failing to advance a $500 billion “skinny” relief package.

Even as Mnuchin negotiated with House Speaker Nancy Pelosi (D-Calif.), Senate Republicans failed to coalesce in favor of more relief. Senate Republicans running for reelection pushed for a vote on an aid package to bolster their electoral fortunes. But other pressures limited GOP support. For one, the economy was improving for top earners, a core GOP constituency, probably lessening pressure on Republicans to act. And GOP deficit hawks, warning of the dangers of red ink, reappeared to oppose more aid — prompting Democrats to accuse them of seeking to hobble the recovery should Biden win the presidency.

Democrats didn’t have much incentive to compromise any further, either. They hoped that a “blue wave” would hand them control of the White House and both houses of Congress, enabling them to enact a large package after Biden took office.

Elections matter

The election results scrambled the players and their priorities.

Consider the Democrats. Once Joe Biden was president-elect and the Democratic Party’s incoming leader, he called for a small relief “down payment.” His incentive was clear: The more help Congress provides today, the smaller the hole the Biden administration has to dig out from once it takes office. That pushed House and Senate Democratic leaders to tell Republicans they’d be willing to pass a package that would be less than half what they’d insisted on before the election. What’s more, with no blue wave, control of the Senate uncertain, and a smaller House majority, Democrats knew they had to negotiate with Republicans, whether now or later.

On the Republican side, McConnell changed gears, warning his GOP colleagues that they had to pass a relief package if they wanted to win the Georgia Senate runoffs. And with Biden and Democratic leaders seeking a smaller deal, McConnell committed to reaching an agreement before the holidays.

Deals are rarely made at the center

Some news outlets are reporting that a small bipartisan group of lawmakers got fed up with the stalemate and broke the logjam by pushing both parties back to the bargaining table after the election. That might be partially true: The group signaled to both sets of party leaders that even a small deal was better than no deal, proposing an agreement closer to the GOP position just as Biden endorsed a small deal.

Still, although the group agreed upon a roughly $900 billion aid package,it failed to resolve a key dispute: How to marry the Democrats’ request for state and local government funding and the GOP’s demand that business be protected from coronavirus-related lawsuits. Party leaders couldn’t bridge the gap either, and jettisoned both.

A group can catalyze action, but only party leaders can typically close a deal in today’s hyperpartisan Congress. That remained true all the way through the need to resolve the very last disagreement blocking the bill: Sen. Patrick J. Toomey’s (R-Pa.) only partially successful effort to curtail the Federal Reserve’s authority over its crisis lending programs.

More cliffs to come

Biden has promised more relief funding after he takes office. Pressure to provide more aid will grow this spring. This package increases unemployment benefits only until March. But the economy won’t begin to recover until most Americans have been vaccinated — which health experts don’t expect until summer or fall.

So will the next Congress deliver on Biden’s promise? That depends in part on the Georgia runoffs. If Democrats pick up both seats, the Senate will be evenly divided between the parties, with Vice President-elect Kamala D. Harris able to break any ties. That would give Democrats a bit more power than they have now.

But if Republicans keep one or both seats, their motivation to negotiate might be limited. Granted, the parties do get some things done, even when they divide control of the government. But Senate Minority Leader Mitch McConnell a decade ago vowed to make President Barack Obama a “one-term president.” While he failed then, McConnell may want to try again.