As the Constitutional Convention of 1787 ended, Ben Franklin walked out of Philadelphia’s Independence Hall to find an anxious crowd. According to a diary entry recorded by James McHenry, a signatory to the Constitution, a woman from Philadelphia was the first to speak to Franklin.

"Well, doctor,” she asked, “what have we got, a republic or a monarchy?"

"A republic,” Franklin famously replied. “If you can keep it."

Perhaps we cannot.

This reads like hyperbole. But is it? Consider, for a moment, the knife’s edge on which the republic rests. The election is 24 hours away. As I write this, Donald Trump is 1.8 points behind Hillary Clinton in the RealClearPolitics polling average. And here is what we know of Donald Trump.

He is a man who routinely praises dictators. Of Vladimir Putin, Trump said, "He's running his country, and at least he's a leader, unlike what we have in this country." Of Kim Jong Un, Trump said, "You've got to give him credit. He goes in, he takes over, and he's the boss. It's incredible." Of Saddam Hussein, Trump said, "He killed terrorists. He did that so good. They didn't read them the rights."

It’s not just that Trump admires authoritarians; it’s that the thing he admires about them is their authoritarianism — their ability to dispense with niceties like a free press, due process, and political opposition.

Trump has promised — in public, and repeatedly — to bring this hammer to American governance. He stood in a nationally televised debate and vowed to jail his opponent if elected. He has proposed strengthening libel laws to make it easier to cow the press and antitrust laws to punish Jeff Bezos and Amazon for the Washington Post’s coverage of his candidacy. In a recent speech at Gettysburg meant to preview his first 100 days in office, Trump said he would sue all of the women who accused him of sexual assault.

During rallies, Trump has exhorted his followers to assault protestors, and has promised to pay their legal fees if their thuggery leads to arrest. He has warned that the only way he could lose the election would be if it is rigged, and has suggested he may refuse to concede.

And all this ignores his more basic flaws. He is cruel, lazy, and reckless. He knows nothing of policy and has not bothered to find anything out. He is easily baited, reliant on sycophants, and prone to conspiracy theories. He is a bigot who slimed an American-born judge for his Mexican heritage and a misogynist who boasted that his celebrity gave him license to commit sexual assault. He has cast doubt on America’s commitment to the NATO alliance and offhandedly encouraged Saudi Arabia and Japan to build nuclear weapons. His business is rife with conflicts of interest, and his campaign has been amateurish and poorly managed.

Here is the compliment I can pay Donald Trump, and I pay it with real gratitude: He never hid who he was. Perhaps he lacked the self-control, or the self-awareness. Whatever the reason, he never obscured his authoritarian tendencies, his will to power, his sexism, his greed, his dishonesty, his racism, his thirst for vengeance.

And he is still only 1.8 points behind.

It is likely, though not certain, that Hillary Clinton will win on Tuesday. But even if she does, here is what must be said of American politics in 2016: We came within inches of electing Donald J. Trump president of the United States of America. We did this even knowing exactly what he stood for, exactly what he had threatened to do, exactly what kind of man he was.

A narrow Trump loss is another way of saying a near Trump win. A 3-point victory for Clinton implies that if Trump were merely a bit more self-disciplined, if he had not bragged about sexual assault while wearing a microphone, if his opponent’s pneumonia had lingered a bit longer, America would be ruled by a cruel narcissist with authoritarian ambitions. It will mean that if unemployment were a few percentage points higher, if the man who murdered two police officers last week had been brown rather than white, if Trump’s odd-bedfellows alliance of Russian hackers and angry FBI agents had been a bit more effective, Trump would have won.

Perhaps, on Tuesday, we will dodge the bullet. But we will still need to understand how we came to be standing in front of a gun.

The comforting, but wrong, explanation for Trump

There is a comforting and popular explanation for Trump’s rise: He is the product of an extraordinary period of economic pain, demographic anxiety, and elite backlash. This argument holds that the condition of the country — or at least the condition of Trump’s supporters — is catastrophic, and Trump’s rise is a response to the suffering.

This is reassuring; it makes Trump into a kind of political natural disaster, a hurricane that relied on a rare alignment of winds and rains and warmth, a combination that occurs once in lifetime and can be forgotten once it’s been survived.

But there is nothing in polls of national attitudes, or indicators of economic health, that reveals this moment as uniquely fertile for the rise of a strongman. In 1992, when Pat Buchanan ran for president on a Trump-like platform, unemployment was higher, consumer confidence was lower, and Americans reported themselves more dissatisfied with the state of the country. But Buchanan lost handily.

And as we have learned more about Trump’s supporters, and have come to understand more about the year in which he rose, these explanations have grown more and more strained.

The belief that Trump is a predictable reaction to acute economic duress crumbled before the finding that his primary voters had a median household income of $72,000 — well above both the national average and that of Clinton supporters.

The idea that Trumpism arose as a response to a stalled economy collapsed as America experienced its longest sustained run of private sector job growth, and the highest single-year jump in median incomes, in modern history.

The idea that Trump was a reaction to failed trade deals and heavy competition from immigrants slammed into data showing support for him showed no relationship to lost manufacturing jobs and was strongest in areas without immigrant labor.

The idea that Trump is a reaction to historic disgust with American elites is at war with President Barack Obama’s approval ratings, which have risen above 50 percent and now match Ronald Reagan’s at this point in his presidency.

The reality is that the patterns of Trumpism, the trends of the US economy, and the polls measuring the American mood have stubbornly refused to fit the comforting theory that this is an extraordinary candidacy that could only emerge in an extraordinary moment. Indeed, if this were a period as thick with economic pain and anti-establishment sentiment as the pundits pretend, Trump’s victory would likely be assured.

Once you appreciate that fact, the lesson of Trumpism becomes much scarier: We are more vulnerable than we thought to reactionary strongmen. It can happen here.

To Americans of another era — particularly the founding era — it would seem bizarre that we are reaching so far, and straining so hard, to explain the popular appeal of a charismatic demagogue. As former Bush speechwriter Michael Gerson wrote:

The founders had little patience for “pure democracy,” which they found particularly vulnerable to demagogues. Men of factious tempers, of local prejudices, or of sinister designs,’ says Federalist 10, “may, by intrigue, by corruption, or by other means, first obtain the suffrages, and then betray the interests, of the people.” A representative government is designed to frustrate sinister majorities (or committed pluralities), by mediating public views through “a chosen body of citizens, whose wisdom may best discern the true interest of their country.”

The American political system is structured the way it is in part due to the founders’ fear of demagogues. It’s a reason why the American presidency is so weak, why the executive is checked by other branches, why the Senate’s members were originally selected by state legislators.

It is a credit to the long success of our political institutions that we think dangerous men can only win elections in far-off lands. And so it is the weakening of those institutions that demands our attention now.

Why Trump didn’t get McGoverned

Donald Trump’s nearness to the presidency rests on two separate accomplishments — or, if you prefer, two separate institutional failures — that are often conflated. The first is his victory in the Republican Party’s presidential primaries. The second is his consolidation of elite Republicans, and of the Republican-leaning electorate.

Trump won the GOP primaries with 13.8 million votes. The distance between those 13.8 million voters and the more than 60 million votes he is expected to receive tomorrow is vast, and was far from assured.

In 1972, for instance, George McGovern won the Democratic primary even though much of the Democratic Party viewed him with suspicion and even fear. Major Democratic interest groups, like the AFL-CIO, refused to endorse him in the general election, and top Democrats, including former governors of Florida, Texas, and Virginia, organized “Democrats for Nixon.” McGovern went on to lose with less than 40 percent of the vote, a dismal showing driven by Democrats who abandoned a nominee they considered unacceptable.

A similar path was possible for Trump. Elites within the Republican Party viewed him with horror. His primary opponents spoke of him in apocalyptic terms. Ted Cruz called Trump a "pathological liar," "utterly amoral," and "a narcissist at a level I don't think this country's ever seen." Rick Perry said Trump’s candidacy was "a cancer on conservatism, and it must be clearly diagnosed, excised, and discarded." Rand Paul said Trump is "a delusional narcissist and an orange-faced windbag. A speck of dirt is way more qualified to be president." Marco Rubio called him “dangerous,” and warned that we should not hand "the nuclear codes of the United States to an erratic individual."

And then every single one of those Republicans endorsed Trump. Ted Cruz told Americans to vote for the pathological liar. Rick Perry urged people to elect the cancer on conservatism. Rand Paul backed the delusional narcissist. Marco Rubio campaigned to hand the nuclear codes of the United States to an erratic individual.

The list goes on. Paul Ryan, the Republican speaker of the House of Representatives, has endorsed Trump, as has Mitch McConnell, the Senate majority leader, and Reince Priebus, the head of the Republican National Committee. Mike Pence, the governor of Indiana, commiserated with Dan Senor, a former Bush appointee, over the fact that Trump was “unacceptable” — and then became his vice president.

With this kind of elite consolidation, it’s little wonder that Trump has managed to consolidate Republican-leaning voters behind him. The final NBC/WSJ poll of the election found that 82 percent of likely Republican voters were supporting Trump — precisely matching the 82 percent of likely Democratic voters supporting Clinton. Trump did not get McGoverned.

There are two analyses that must be made of this. The first is moral. There are many Republicans who honestly believe Trump will make a good, or at least adequate, president; their endorsement of his candidacy is perfectly honorable, even if I think it wrongheaded. But many of the Republicans mentioned here believe Trump is a threat to world peace and to fundamental norms, values, and institutions of American democracy; their endorsements of his candidacy will stain the rest of their careers, and if he is elected, and if the worst comes to pass, they will be remembered by history for their abandonment of country.

The second analysis that must be made is structural. And, believe it or not, that’s where things get scary.

The bug in American democracy: weak parties, strong partisanship

Political scientist Julia Azari has written the single most important sentence for understanding both Trump’s rise and this dangerous era in American politics: “The defining characteristic of our moment is that parties are weak while partisanship is strong.”

Here is the problem, in short: Parties, and particularly the Republican Party, can no longer control whom they nominate. But once they nominate someone — once they nominate anyone — that person is guaranteed the support of both the party’s elites and its voters. Unlike in McGovern’s day, when ticket splitting was common, any candidate able to win his party’s presidential primaries can now count on his party’s support, and so has a damn good chance of winning the presidency.

Political parties, and political party primaries, were traditionally bulwarks against demagogues rising in American politics — they were controlled by gatekeepers who acted as checks against charismatic demagogues. Donald Trump would never have made it through the convention horse-trading that used to drive nominations; he would never have survived a process that required support from party officials.

But in recent decades, we have slowly destroyed the ability of party officials to drive party primaries. What’s more, we have come to see party officials exercising influence as fundamentally illegitimate.

“Political scientists think of parties as the fundamental building blocks of democracy, and people think of them as the impediment to democracy,” says Hans Noel, a political scientist at Georgetown University. “In other systems, you wouldn’t even have primaries — the whole thing would happen at a party convention. But here, when the DNC makes choices that influence the outcome of a primary, that looks undemocratic.”

The results have been stark. The reigning political science theory of primaries going into this election was known as “The Party Decides,” and it stated, basically, that party elites controlled primary outcomes by driving money, media attention, and endorsements.

No single idea has been as decisively wrecked by 2016 as that one. And when you examine the reasons for its failure, you see they are unlikely to end with Trump.

Money turned out to be much less important to winning primaries than anyone thought — just ask Jeb Bush, who spent $130 million only to be humiliated, even as Trump spent almost nothing to win. Moreover, the internet keeps making it easier to fundraise off an energized base — a dynamic that is empowering high-enthusiasm outsider candidates like Bernie Sanders and Ted Cruz and weakening party establishments and the big-dollar donors they control.

Similarly, parties used to drive media attention by signaling to reporters which candidates to take seriously. But that process, too, has been democratized — social media makes it easy to communicate with supporters directly and made it more valuable for audience-hungry media outlets to cover the candidates with intense fan bases that send stories viral across Facebook or Reddit. That, again, favors exciting outsiders with enthusiastic supporters over vetted establishment grinds.

But the primary resource party officials have when influencing primary elections is the trust of voters. That’s why endorsements are important, and have traditionally been predictive of the eventual winner: They represent party officials using the credibility they have built with their voters to persuade them of whom to vote for.

Trump didn’t have any Republican endorsements to speak of until he had already won a slew of primaries. But the void of official support arguably helping him — it was proof that he really was untouched and untainted by the unpopular GOP establishment. This represented the Republican Party failing at the most basic job of a political party: Helping its voters make good decisions. The GOP’s elites have so totally lost the faith of their base that their efforts to persuade Republican voters were ignored at best and counterproductive at worst.

But this also presents a puzzle: If partisans have lost so much faith in their party establishments, then why are they so much likelier to back whomever their party nominates? The answer, in short, is fear and loathing of the other party.

Since 1964, the American National Election Studies have been asking Republicans and Democrats to describe their feelings toward the other party on a scale that runs from cold and negative to warm and positive. In 1964, 31 percent of Republicans had cold, negative feelings toward the Democratic Party, and 32 percent of Democrats had cold, negative feelings toward the Republican Party. By 2012, that had risen to 77 percent of Republicans and 78 percent of Democrats.

Today, fully 45 percent of Republicans, and 41 percent of Democrats, believe the other party’s policies “threaten the nation’s well-being.” This fear is strongest among the most politically involved. Which makes sense: You're more likely to take an active interest in American politics if you think the stakes are high. But that means the people driving American politics — and particularly the people driving low-turnout party primaries — have the most apocalyptic view of the other side.

This is driven by the reality that the two parties have grown more ideologically distant from each other, and so the stakes of elections really have grown larger. In 1994, 34 percent of Republicans were more liberal than the median Democrat, and 30 percent of Democrats were more conservative than the median Republican. Today only 8 percent of Republicans are more liberal than the median Democrat, and only 6 percent of Democrats are more conservative than the median Republican.

And polarization begets polarization. The angrier and more fearful partisans are, the more of a market there is for media that makes them yet angrier and yet more fearful. It is no accident that the CEO of Breitbart News, a hyper-ideological conservative media outlet that specializes in scaring the hell out of its audience, is leading Trump’s campaign. One reason Trump has been able to consolidate Republican support is that Republican-leaning media has convinced itself, and its base, that the alternative to Trump is a criminal who belongs in jail. This offers a rationale for voting Republican even if you don’t particularly like your candidate: a majority of Trump voters say they are voting against Clinton rather than for Trump.

This raises the possibility that Trump’s support from Republicans is merely an artifact of Clinton’s unpopularity. I’m skeptical. Before they had convinced themselves Clinton is a criminal, many Republicans — led by Trump — convinced themselves Obama was born in Kenya and constitutionally ineligible to serve as president. And while those attacks were driving Obama’s popularity down, Clinton’s numbers were so high that it became fashionable to speculate over whether Obama needed to replace Joe Biden with Clinton to win reelection.

Clinton’s weaknesses are real, but her unpopularity among Republicans is structural — her four percent approval rating among Republicans isn’t so far off from the six percent Obama registered at the end of the 2012 election.

“We’ve got this online media where the profits are driven by controversy and clicks,” Sarah Rumpf, a former Breitbart writer, told Vox. “It’s just an activism problem in general, where it’s easier to fundraise and easier to get members when you can declare an emergency, when you can declare a crisis, when you can identify an enemy.”

This helps explain the unified party support for Donald Trump. Republican officeholders are terrified that if they don’t support him, or are seen as in any way contributing to Clinton’s election, they’ll face the wrath of their conservative base and be defeated in the primary challenges that the Tea Party used to such devastating effect in 2010 and 2012. Paul Ryan got a taste of this after distancing himself from Trump after the release of the Access Hollywood tape: His popularity plummeted, and a majority of Republicans said they preferred to see Trump representing the party than Ryan.

So here, then, is the key failure point in modern American politics, and observing it in action requires looking no further than the Republican Party: Voters’ dislike of their own party has broken the primary process, but fear of the opposition has guaranteed unified party support to the nominee. That means whoever manages to win a flawed competition dominated by the angriest, most terrified partisans ends within spitting distance of the presidency.

Party primaries were traditionally bulwarks against demagogues rising in American politics. Now they are the method by which they will rise.

The gatekeepers no longer control the gates

“The thing I keep coming back to is the Muslim ban,” says MSNBC’s Chris Hayes. “That was an actual policy he called for while running for president, and if you switched in Jews for Muslims, it was immediately clear what it was. And it wasn’t disqualifying. To me, that was so, so upsetting.”

Hayes is the author of the book Twilight of the Elites, and he has spent a lot of time thinking about elite failures. And there were elite failures that led to Trump: the anger left over from the Iraq War, and from the financial crisis, is certainly part of his rise. But the other problem with elites this year is harder to talk about: They were underpowered.

“The gatekeepers have been extraordinarily diminished,” Hayes says. “The best example of this, to me, is the newspaper editorial page. It’s the ultimate old-school gatekeeper. I find it so remarkable that the Columbus Dispatch, USA Today, all these gatekeepers have come to the proper, correct conclusion on Trump, and said, ‘No fucking way!’ But no one cares. They don’t control the gate. They can lock the gate and someone can walk around it three feet down the fence.”

Elites are often blamed for Trump’s rise — he is said to be the backlash to their failures, their corruption, their obliviousness, their self-dealing, their cosmopolitanism, their condescension. All that may be true, but past moments in American politics have also featured angry voters, out-of-touch elites, and social problems. Those moments, however, featured political and media gatekeepers with more power, and so Trump-like candidates were destroyed in primaries, or at conventions, or by a press that paid them little mind.

Now, however, traditional gatekeepers have neither the power nor the cultural capital to stop Trump-like candidates. And in the Republican Party, where the collapse of institutional authority is most severe and most dangerous, the aftermath of a Trump loss will further weaken the party’s center, as Trump’s supporters turn on the elites whose tepid backing, they will argue, doomed their candidate. Sean Hannity, for instance, has already called Paul Ryan a “saboteur,” and Breitbart published an article headlined “He’s with her: Inside Paul Ryan’s months-long campaign to elect Hillary Clinton president.’”

It is hard to see how the Republican Party’s core institutions or top officials emerge strengthened if Trump loses narrowly, and it is likely that they will be effectively replaced, co-opted, or hollowed out if he wins.

Meanwhile, the social conditions that led to Trump — the rapid browning of America foremost among them — will persist and even accelerate. Already, nonwhites make up a majority of children under 3 years old. The country is on a fast path to becoming majority minority, and many white male voters will continue to perceive this change as a loss in both status and political power, which, in some ways, it is. Eventually, these conditions will run into a recession that brings with it much sharper economic pain.

This is not to say Republicans will always, or even routinely, nominate candidates as dangerous as Trump. Much had to go wrong for him to be nominated. But having been nominated, much will have to go right for the country not to elect him, and more will have to go right for it to not elect someone like him in the future. The lesson of this unnerving year is that less can be taken for granted than we thought — the American people are not immune to demagogues, and the American political system is too weakened to reliably stop them. America, like all the world’s other countries, is vulnerable to catastrophic political failure. It can happen here.

Trump will likely lose on Tuesday. But if he loses, it will be because he is a crude, undisciplined demagogue. The world also produces clever, disciplined demagogues. And they are the ones who truly threaten republics.

Watch: Trump's success reveals a frightening weakness in American democracy