The Democratic National Convention will open Monday in a spirit of unity and shared purpose, with the party’s often-warring moderate establishment and galvanized liberal wings agreeing for now to set aside their differences to defeat President Trump in November and deliver the White House to Joe Biden.

That’s not to say that divisions and disagreements don’t exist. They do and probably will be back if Biden wins, potentially complicating his efforts to govern. Still, the overall mood on the eve of this year’s convention contrasts with that of four years ago, when Hillary Clinton arrived in Philadelphia still dealing with the grievances of a long and rugged nominating contest against Sen. Bernie Sanders (I-Vt.).

That Democrats today appear far more unified is testament in part to the work of Biden, Sanders and their teams over the past several months to avoid a repeat of the 2016 experience. But the unity owes much more to the occupant of the White House, whom many Democrats fear could inflict lasting damage to the country and its democratic institutions if he gains a second term.

“Four years ago, you could point to Donald Trump as the wolf at the gate, but it was still theoretical,” said Pete Buttigieg, the former South Bend, Ind., mayor who ran unsuccessfully against Biden in the primaries. “Now the wolf is through the gate, eating the chickens.”

For the Democratic rank and file, the goal of preventing Trump from winning a second term overrides almost everything else between now and November. It was that sentiment that ultimately helped deliver the nomination to Biden.

The candidate, whose nomination will be made official Tuesday, was seen as better positioned to win a general election than Sanders, who had harnessed the power of liberal activists enough to be the front-runner for the nomination until a weakened Biden saw his candidacy resurrected by Black voters in the South Carolina primary.

Since the unexpectedly rapid conclusion to the primary battle, Democrats have been sobered toward unity by the arrival of the coronavirus pandemic, Trump’s mismanagement of the crisis and the challenges all that presents to the country. They are aware that, if Biden wins in November, he and the party will inherit a set of emergencies unlike anything seen since the days of the Great Depression or before.

In that case, the party’s future could depend on how effectively a prospective Biden administration harnesses the power of government to deal with the pandemic and the related economic emergency and also to address issues of racial justice and reconciliation that many in the party now see as more urgent than ever.

For all those reasons, the majority of Democrats believe it is in their interest to come together — at least until November.

The issue differences between the energized liberal wing and more dominant centrist wing have been harmonized ahead of the convention throughwhat William Galston of the Brookings Institution calls “pretty skillful internal party management by the Biden forces.”

But, he added, “I think that’s a truce, not a peace treaty.”

Meanwhile, the nomination of Sen. Kamala D. Harris (D-Calif.) as Biden’s running mate highlights but will far from satisfy the aspirations of women, minorities and, more broadly, a younger generation of Democratic leaders to have a larger voice in all deliberations.

Those who went through the 2016 Democratic nominating process agree that the atmosphere inside the party today is far better than it was four years ago.

“There’s been much closer cooperation,” said Jeff Weaver, a top Sanders adviser who was with the senator through both campaigns. “There’s been much more openness on the part of the Biden campaign to welcome the progressive wing into their electoral coalition. There’s been much more openness to try to find policy common ground there that’s possible.”

Democrats who support Biden suggest another reason for optimism about party unity: the almost-completely virtual convention denies any opponents of the presumptive nominee a high-profile forum in which to publicize their grievances. In 2016, Sanders backers criticized Clinton on the streets of Philadelphia before moving their objections inside to the convention floor; their protests were widely aired on television and social media.

The issues in 2016 were complicated by a persistent belief by the Sanders forces that the Democratic National Committee had worked to assure Clinton’s nomination and to frustrate Sanders’s candidacy. DNC officials insisted that wasn’t the case, but that never satisfied Sanders’s team or supporters.

“One of the things that has made it easier for folks to come together after the primary was that, by and large, the process itself was an evenhanded application of the process,” Weaver said. “There were bumps in the road . . . but in terms of all the candidates being treated equally, there was no finger on the scale for one candidate or the other.”

Biden’s senior advisers give considerable credit to Sanders and his willingness to come together quickly once it was clear that Biden would be the nominee. Lines of communication between the two camps were open even before that, and more serious talks began after the March 17 primaries that sealed Biden’s victory. Both sides agreed it was not in the interest of the party to let things fester to the convention if the common goal was to defeat Trump.

Some leaders of grass-roots activist organizations credit Biden for recognizing the need to accommodate the left. “The Biden team was clear you needed to engage those folks,” said George Goehl, executive director of the grass-roots organizing group People’s Action. “That was very practical political thinking.”

As a way of quickly sending a signal to the left, Biden adopted ideas favored and advanced by either Sanders or Sen. Elizabeth Warren (D-Mass.) in her presidential campaign. One was to lower the age for Medicare eligibility to 60 and another was to strengthen Biden’s previous position on student debt forgiveness.

A major piece of the strategy was the Biden campaign’s creation of issue task forces composed of elected officials and others who represented the full breadth of the party. Perhaps the most symbolically significant pairing was the task force on climate, which included former secretary of state John F. Kerry, an establishment Brahmin and close friend of Biden, and Rep. Alexandria Ocasio-Cortez (D-N.Y.), the star of the party’s insurgent wing.

Democrats this year have put together the most liberal platform in the party’s history, including ideas that were advanced by Sanders in his 2016 campaign but rejected then by many in the party’s center-left cohort.

Neera Tanden, president of the Center for American Progress, a liberal think tank, argues that Trump has been an agent in helping to make some liberal ideas appear more mainstream. She cited shifts in attitudes on policing and racial issues, universal health-care coverage, support for a $15-an-hour minimum wage and expanded unemployment insurance as examples of policies that enjoy broader support than in the past.

“What I’m saying is the country has become more liberal in response to Trump,” she said, adding: “The party is not left. It has become more liberal. There’s a strong wing of the party that is left. It is not a majority. Whenever we have a swing state or a statewide race, the moderate wins or the non-left candidate wins. Left candidates win in urban districts, in very Democratic districts.”

Even with some dissenters, the nomination battle appeared to settle for now where the majority of Democrats stand. “We had a battle in the primary between reform and revolution, and reform won,” said Rahm Emanuel, the former mayor of Chicago who is in the moderate wing of the party. “Primary voters and activists are more pragmatic than the leaders of the movement.”

Emanuel argued that Democrats now have an opportunity to expand their coalition by attracting onetime Republicans disillusioned by their own party, but not if Democrats move too far to the left.

That intraparty truce probably holds through Nov. 3, but not necessarily beyond.

“I think progressives are going to fight like hell to get a Democratic president and a Democratic Congress, and then we’re going to fight like hell to get big, bold policies passed,” said strategist Rebecca Katz.

Though Biden and Harris will have articulated their policies during the campaign, a prospective Biden administration would still face intraparty debates over the details of those policies, from health care to climate to policing, even the scope of an economic recovery plan.

Biden, for example, opposed Medicare-for-all, preferring to add a public option to the Affordable Care Act. But Democratic voters came down in a different place. Averaging the results of exit polls across 22 contests last winter, 58 percent of Democratic primary voters and caucus-goers supported a single-payer system while 37 percent opposed it.

Even if Medicare-for-all lacks necessary support in Congress, Biden would need to be mindful of those sentiments as he confronts a health-care system whose inequities have been exposed by the coronavirus pandemic.

LaTosha Brown, co-founder of Black Voters Matter Fund, sees policing as a potential flash point, arguing that the Black Lives Matter movement has called for changes far more expansive than those embraced by Biden in the campaign.

“At the end of the day, you’ve got a large progressive wing of voters who want a complete restructuring of the criminal justice system and police accountability, and you’ve got the left who says we want to defund the police and the candidate saying, ‘I’m going to give police $300 million more,’ ” she said.

Galston describes the fault lines as following typical parameters of dispute between a realist faction and an aspirational faction. “The realists are saying we may only have one shot at this and we’d better figure out how much we can get and push for that and no more,” he said. “And the aspirational faction will say incremental steps won’t be enough and we live in a time when all of the old policies and verities and assumptions have gone out the window.”

Articulating that aspirational sentiment, Reggie Hubbard, congressional liaison and senior strategist for MoveOn, said: “We need bold solutions here. There’s no piecemeal compromise to fixing health care right now. There’s no piecemeal for economic insecurity. . . . People are just going to push more to the left.”

Buttigieg said some of the differences could be more easily resolved than might have been the case before the pandemic.

“Some of these battle lines fall away a bit because the enormity of the challenge means that some of the pragmatic decisions will turn out to be bold,” he said. “Positions that might have been considered far to one side before could stitch together a coalition of left, right and center.”

Goehl said that if there is a Biden administration, the party’s left wing doesn’t just want to advocate for specific ideas but wants to be included as part of the governing process.

“Will Democratic centrist forces that are often too cozy with Big Ag and the big banks be at the central table?” he asked. “Are they going to be there with folks from social movements in a real way? Who’s going to be at the table when decisions get made?”

The left wants to be represented in Cabinet and White House appointments as well, if Biden wins, arguing that liberal activists are supplying energy and ideas that speak to and for a younger, more diverse generation that is rising within the party coalition. How they are integrated into the party’s hierarchy will be another test.

“I think that younger voters and people of color and women are asserting themselves as voices that not only deserve to be listened to but deserve to have real power in the party,” said Democratic pollster Geoff Garin. “By any measurement, those groups are all critical to the success of Biden in the short term and the Democratic Party in the long term.”

With considerable focus on Black voters, one important constituency, Latinos, often feels left to the side. During the primaries, Sanders did particularly well with Latino voters, especially younger ones, in part because he paid attention to them.

“What explains Bernie’s strong numbers is he did a lot of outreach,” said Democratic pollster Matt Barreto, who is working with the Biden campaign. “Not every Latino that Bernie got to vote for him was a super-progressive. For some, that was the only outreach they got.”

Barreto said Biden’s campaign is now working harder to appeal to younger, more liberal Latinos and to newly naturalized citizens, two groups where advisers believe he has room to grow before November.

Ocasio-Cortez, though she has sometimes clashed with party leaders, will have a speaking slot at the convention, albeit short, as are nearly all but the handful of major speeches. That decision was applauded by some Latino strategists who see her as a way to generate more enthusiasm for Biden among younger Latinos.

“If there was ever a surrogate who was underutilized to appeal to younger Latinos, it’s AOC,” said Albert Morales, a Democratic pollster. “She’s brought a new generation of young people to politics.”

Democrats are optimistic about November, but Trump dashed similar hopes four years ago, as party officials and strategists are mindful of. Given the focus of all parts of the party on defeating the president, what would happen if Biden were to lose the election?

“All of the willingness to put disagreements aside will go by the boards,” Garin said. “And I think the center and the left of the party will really have it out.”

But he offered a closing thought: “Having said that, when you think about the two political parties today, the Democrats are in 100 times better shape than the Republicans.”

Still, much depends on the outcome on Nov. 3.

Scott Clement contributed to this report.