The outcome of the election in November will shape the remainder of Biden’s first term in office. The midterms will also set the next election cycle in motion, forcing him to start laying the groundwork for his reelection bid — assuming he decides to run again — and Democrats to begin preparing for a much more challenging political map in the Senate in 2024.

Senate Democrats will be on defense in two years, with fewer opportunities on the horizon as of now to flip Republican-held seats or make pickups in purple states. Twenty-three Democrats will be up for reelection in 2024, compared to just 10 Senate Republicans.

That makes 2022 the Democrats’ best chance to build a Senate firewall to protect Biden against House Republicans, who are widely expected to win back the lower chamber and use their new power next year to launch multiple investigations into the president and his family.

“A win in the Senate, even in the face of a loss in the House, would be a tremendous success,” said Jerry Crawford, a veteran Democratic power broker in Iowa.

A Republican-controlled House is likely to tie the White House up with sprawling investigations into everything from the president’s son Hunter Biden’s business dealings to the administration’s pandemic response. A GOP-led Senate would also likely block the president’s appointments and stymie Biden’s legislative agenda.

In recent weeks Democrats have become increasingly optimistic they can hold on to the evenly divided, 50-50 Senate. Retaining control of the House is viewed as much more of a longshot by party insiders, though few now expect Democrats will suffer a historic loss on the scale of the 2010 midterms, when the party lost 63 seats in the House under then-President Barack Obama.

The “shellacking” that Democrats took, as Obama famously put it, left his administration on the defensive and effectively brought his domestic agenda to a standstill. The remainder of his first term in office was dominated by partisan battles over the Affordable Care Act and government spending.

A better-than-expected performance by Democrats would give Biden momentum heading into 2023, creating some breathing room for the White House to focus on implementing the Inflation Reduction Act and other policies before the presidential primary season gets into full swing.

If Democrats escape with their slim Senate majority intact, it would also represent a rejection of the Republican candidates backed by former President Donald Trump.

“The president’s legacy is not just his legislative achievements. It’s also his management of America and the world,” said Tad Devine, a Democratic strategist.

A strong showing by Democrats in November would help set Biden up to seek a second term if he chooses to run again, or at least give him breathing room to take his time before making a final decision.

There could also be a political upside for Biden if House Republicans spend the next Congress focused on investigating the White House and Trump mounts a new presidential bid, Devine said.

“When the focus starts to be, ‘what’s the future going to look like between Biden and Democrats and Trump and Republicans?,’ Biden will come out looking stronger,” Devine said.

Still, Devine and others cautioned that if Democrats do well in November, they shouldn’t confuse that with unequivocal support for Biden and his policies.

Democrats are competitive in battleground states this cycle “not because we have a great message or we’re so well-positioned,” he said. “The real reason is Donald Trump has gone out and recruited terrible candidates, and we have a chance to beat them. That’s the reality.”

Wins by controversial Republican candidates like Georgia’s Senate nominee Herschel Walker would deal Democrats an embarrassing blow and signal Biden may have a more challenging path to reelection in 2024, regardless of his opponent.

Kait Sweeney, the spokesperson for the progressive group Democracy for America, said there would be “a lot of soul searching” within the party if Democrats suffer major setbacks at the polls in November.

“Yes, there’d be criticism of Biden for not taking bolder positions,” Sweeney said, but Democrats would “also have to think harder about why we’re struggling so much with working class voters,” as well as with Black and Latino men.

“2022 has to be a bit of a wake up call for Democrats,” she added.