ABC News January 5, 2022

Beyond the riot, Jan. 6 was a dangerously close call. How Trump's plot nearly succeeded: ANALYSIS

WATCH: Capitol insurrection: 'It felt like a warzone'

Two weeks after the Jan. 6 insurrection, Donald Trump walked out of the White House and Joe Biden became the 46th president of the United States. Trump had attempted to use the full power of the presidency and his position as the leader of the Republican Party to stay in power, but he failed. Democracy succeeded. Joe Biden became president, on schedule and without incident, at noon on Jan. 20, 2021.

Homegrown: Standoff to Rebellion
A look at the days, events and conversations leading up to Jan. 6, 2021, from the eyes of anti-government groups, extremism experts and several ABC News correspondents who were at the Capitol that day.
Stream On

But this was a close call. Attempts by Trump and his followers to overturn the results of the 2020 election -- multi-dimensional efforts of which the assault on the Capitol building was only one element -- came dangerously close to succeeding.

Tasos Katopodis/Getty Images
President Donald Trump speaks at the "Stop The Steal" Rally, Jan. 6, 2021, in Washington, D.C.

Consider, for example, Donald Trump’s demand that Vice President Mike Pence act to nullify Biden’s victory on Jan. 6. Trump wanted Pence to use his power as the presiding officer during the joint session of Congress that day to toss out Biden’s electoral votes in states Trump had contested. On its face, the idea of giving one person the power to overturn the votes of millions of Americans was absurd. And outside of a few fringe lawyers advising Trump, constitutional scholars agreed that Pence had no authority to do what Trump was demanding.

But what if Pence had followed Trump’s order? What would have happened if he had brought the gavel down during the joint session on Jan. 6 and thrown out Biden’s electoral votes in the states Trump had contested? What if he had declared Trump the winner of those states?

MORE: Jan. 6 anniversary points to bigger fights ahead for democracy: ANALYSIS
Pool/Getty Images
Vice President Mike Pence presides over a joint session of Congress to certify the 2020 Electoral College results, Jan. 6, 2021, in Washington, D.C.

J. Michael Luttig, a former federal appellate judge popular among conservatives, had advised Pence he would be violating the Constitution if he followed Trump’s order, and Luttig tells ABC News that if Pence had attempted to do it, he would have "plunged the country into a constitutional crisis of the highest order."

While it may be clear that Pence did not have the authority to unilaterally reject electoral votes, it is unclear who would have had the authority to overrule him. Some have suggested the matter would simply have had to be resolved by the Supreme Court, but it is unclear the justices would have agreed to decide such a case because the Constitution arguably leaves it up to Congress to decide its own rules for counting contested electoral votes.

"It would have presented America, and the three branches of our government in particular, with what each branch would have viewed as seemingly irresolvable constitutional issues," Luttig said.

4th U.S. Circuit Court of Appeals via AP
This undated photo provided by the 4th Circuit Court of Appeals shows Judge J. Michael Luttig.

Luttig believes the Supreme Court would have ultimately taken up the issue, but, he says, with no explicit constitutional authority to do so, it’s not certain the justices would have agreed to resolve the dispute.

"Had the Supreme Court refused to decide these issues," Luttig told ABC News, "the country and our democracy would have spiraled into a chaos from which neither would have soon recovered, literally jeopardizing our national security. The legitimacy of our democracy would have been forever drawn into doubt and its luster could never have been restored."

And even if the Supreme Court had decided to intervene, there would have been chaos and uncertainty as the process played out.

"There would have been utter chaos in America until our country and its institutions of government could sort it all out," Luttig said.

Los Angeles Times via Getty Images
The Supreme Court of the United States stands in Washington, Dec. 7, 2021.

This constitutional crisis was avoided because Pence defied Donald Trump’s order. Pence was not alone. The peaceful transition of power ultimately happened, in large part, because Pence and others refused to take part in Donald Trump’s effort to seize the power to choose the president of the United States from the American voters.

MORE: A year after Jan. 6, how Trump keeps pushing the 'big lie': ANALYSIS

On Jan. 6, ABC News Live will provide all-day coverage of events marking one year since the attack on the U.S. Capitol and the continuing fallout for American democracy.

Many of those who defied Trump were Republicans and had been loyal Trump supporters. It’s not hard to imagine scenarios where some of them would have gone along with Trump’s demands, with disastrous consequences.

Georgia’s secretary of state, Brad Raffensperger, was a Republican who endorsed Trump and voted for him. Trump demanded he "find" enough votes to overturn the results in his state. He threatened him. Raffensperger refused. What if he hadn’t? There was no guarantee Raffensperger would do the right thing.

Trump demanded Republican leaders of the state legislatures in Georgia, Pennsylvania and Michigan overturn the elections in their states by sending to Washington Trump electoral votes instead of electoral votes for Biden, who actually won their states. They didn’t do it. What if they had tried?

Trump told his secretary of Homeland Security he wanted him to seize voting machines in states he lost -- a demand made first by Trump and later through his young enforcer, Johnny McEntee, director of the Presidential Personnel Office. Chad Wolf, the acting secretary, had no authority to do that and he refused. But what if he had tried?

Judges, some of them conservative Republicans Trump had nominated, rejected multiple lawsuits aimed at overturning the elections. What if they had gone along with Trump’s power grab and ruled in his favor as Trump clearly hoped they would?

Trump bluntly demanded that the Supreme Court -- with a clear conservative majority thanks to the three justices he nominated -- intervene and save his presidency. In the end they unanimously rejected his final appeal. What if the conservative majority in the Supreme Court acted the way Trump expected them to act?

Pool/Getty Images
Attorney General Bill Barr holds a news conference to provide an update on the investigation of the terrorist bombing of Pan Am flight 103 on the 32nd anniversary of the attack, at the Department of Justice, Dec, 21, 2020, in Washington, D.C.

What if Bill Barr had followed the president’s orders and mobilized the considerable resources of the Department of Justice to overturn the election? Barr had seemed willing to stand by the president, but in the end, he incurred Trump’s wrath by not only failing to do what Trump demanded, but by publicly declaring there was no evidence of widespread voter fraud. What if Barr had not stood up to Trump?

Barr’s successor, Jeffrey Rosen, held the line, too. And when Trump tried to fire Rosen, nearly a dozen senior Justice Department officials threatened to resign. What if instead of threatening to resign in protest, they had agreed to go along with Trump's plans to use the Justice Department to overturn the election?

None of these people had the authority to do what Trump demanded, but there is no guarantee the orderly transfer of power on Jan. 20 would have happened if they had tried to do what he demanded.

It may also be said of these people that they saved our democracy by refusing to break the law. Some of them paid a steep price for doing the right thing. Brad Raffensperger, for example, became a target of death threats that continued months after the election and that were focused not just on him but also his family. People who believed Trump’s lies about the election somehow got Raffensperger’s wife’s phone number and bombarded her with threatening and pornographic messages.

The pressure was intense, but he stayed focused and did what the law required him to do. "Sometimes a person has to stand up and be counted," Raffensperger told me. "I’ll stand up and be counted because I stood on the truth."

The system held. Democracy prevailed. But there were many steps along the way where we were perilously close to a complete breakdown, a true constitutional crisis.

Ultimately, Donald Trump left office peacefully and without incident on Jan. 20 primarily because he had failed, and failed spectacularly, in each and every attempt he had made to prevent Joe Biden from becoming president.

Jonathan Karl, ABC News Chief Washington Correspondent, is the author of "Betrayal: The Final Act of the Trump Show."