In Georgia, a high school senior organized her classmates to be poll workers so voters would not have to wait hours in line like they did back in June.

In Wisconsin, Milwaukee officials leased the whole floor of a downtown office building to serve as the headquarters to count a record number of absentee ballots.

And in Michigan, the secretary of state organized three shifts of more than 700 people each in Detroit who counted twice as many ballots as they had for the August primary in just over half as much time.

Even as the nation waited for the call designating the winner — Joe Biden was declared the victor Saturday — it had reason to breathe a sigh of relief. Despite warnings of violence, threats of foreign interference, rampant disinformation, cuts to the Postal Service, President Donald Trump’s sowing of distrust and a pandemic that forced the relocation of thousands of polling places, the machinery of American democracy adapted and held up this past week.

The result was a relatively smooth election free of the hours-long lines and vote-suppressing shenanigans that have characterized the voting experience in recent years, particularly during the primaries of the coronavirus era.

The performance was the result of months and, in some cases, years of planning for a transition from Election Day voting to expanded absentee and early in-person balloting. It involved elections administrators at all levels of state and local government and tens of thousands of new poll workers, lured to perform a civic duty that had never before required taking a personal health risk to allow their fellow citizens to exercise their right to vote.

“There was never a moment when I didn’t think it was going to work because I believe in the American people,” said Adrian Fontes, the top elections administrator in Maricopa County, Arizona, which includes Phoenix and 60% of the state’s voters. “We are a raucous, dysfunctional family who will stand together in the best of times and in the worst of times. If you can’t believe that, then you have no business running American elections.”

For months heading into November, there was a growing and influential crowd of American doomsayers warning of one calamity after another that could befall the election. Now that the voting is over and took place without a catastrophic structural failure, a crippling cyberattack from abroad or extralegal interference from the Trump administration, those who spent the summer and fall sounding alarms said that without their warnings the worst-case scenarios might have come to pass.

Rosa Brooks, a Georgetown University law professor who convened a group to brainstorm ways the Trump administration could disrupt the election, said the warnings prompted more planning from the news media and local government agencies.

And with the counting, recounting and legal challenges still underway, Brooks said the country’s deep divisions and easy access to disinformation meant the threat of political violence remained high.

“This is like in Harry Potter where in Book 3 everybody thinks Voldemort is dead, but he’s not,” she said. “Nobody should prematurely think we can relax and stop worrying about right-wing extremism.”