Donald Trump knows he’s going to lose the election. And he’s already explaining why he will: because Hillary Clinton stole it.

Trump has always been a conspiracy theorist. As his campaign collapses, he’s building his grandest conspiracy theory yet. Hillary Clinton, Democrats, nonwhite voters, and the media, Trump says, are colluding to tilt the system against him, culminating in “large-scale voter fraud” at polling places that will rip his deserved victory from him and hand it to his rival.

“Hillary Clinton should have been prosecuted and should be in jail,” Trump tweeted Saturday. “Instead she is running for president in what looks like a rigged election.” If there were any question that he might be using the term “rigged” metaphorically, he cleared it up: “The election is absolutely being rigged by the dishonest and distorted media pushing Crooked Hillary — but also at many polling places — SAD.”

This is pure fantasy. Voter fraud simply does not exist in America at a scale large enough to rig an election. American elections have so many overlapping layers of oversight that experts say manipulating the results would be close to impossible. Clinton is likely to win because Trump has run an incompetent campaign and because she has always been likely to win, even before Trump added bragging about sexually assaulting women, something many women say he has done, to his already long list of racist, sexist, Islamophobic, and bigoted remarks.

Trump’s fantasy is contagious

Trump’s fantasy is contagious. Radio shows and op-eds are entertaining the idea that he might win, even in a landslide, and not concede. Sen. Jeff Sessions, among other prominent supporters, has adopted his “rigged” rhetoric. Trump voters can sign up to be election “observers,” looking for, as one Trump supporter told the Boston Globe, “Mexicans. Syrians. People who can’t speak American.”

More clear-eyed Republicans, including House Speaker Paul Ryan, are trying to tamp down the conspiracies. But many of them bear responsibility for nurturing the same vision of widespread voter fraud that Trump has bought into.

While the nominee’s other conspiracy theories — that Ted Cruz’s father was involved in the John F. Kennedy assassination, or that President Obama was not born in the United States — are the product of the fringe, the idea that Democrats and nonwhite voters will steal elections if they’re not stopped is an old canard within the Republican Party. Just eight years ago, John McCain suggested that the community organization ACORN was trying to steal the election out from under him with help from Barack Obama.

Trump, as he often does, is simply blowing the dog whistle too forcefully and turning the subtext into text. The myths he’s embracing have usually been used to justify policies that tilt elections in favor of Republican candidates. Trump is taking it a step further: He’s using them as an excuse not to concede.

Trump has taken Republican ideas about voter fraud and turned them up to 11

If Trump believes Democrats are committing massive voter fraud and stealing the election, there’s a good reason why he thinks so: Top Republicans have been telling him it’s true for years.

Worrying that your political enemies are going to steal the election — or that they already have — isn’t confined only to conservatives. Supporters of candidates from either party who lost elections are generally more likely to doubt that votes were counted correctly, political scientists Michael Sances and Charles Stewart concluded in a 2015 paper.

The runup to the 2004 election featured alarmed warnings from the left that touchscreen voting machines manufactured by companies with links to Republicans were going to permit Republicans to steal the election. Robert F. Kennedy Jr. wrote a cover story in Rolling Stone in 2006 arguing that George W. Bush had stolen the election through a combination of voter suppression and fraud in Ohio.

But these theories, while they got prominent play in the media, were far from widely accepted among liberals. Salon and Mother Jones, both left-leaning outlets, were sharply critical of the idea that the GOP stole Ohio in 2004. Prominent Democratic strategists and candidates weren’t whipping up fear of touchscreen machines going into the 2006 and 2008 elections.

Among Republicans, though, ideas about stolen elections are much closer to the center of the party than the fringe. There is a persistent and widely accepted narrative that voter fraud is a pressing threat to democracy — even though investigation after investigation has turned up conspicuously little evidence that this fraud is actually happening.

There is a widely accepted narrative that voter fraud is a pressing threat

Right-leaning outlets help spread anecdotes, such as the story about the Philadelphia precincts where every voter voted for President Obama, but the idea that Democrats and their allies are trying to steal elections — particularly by manipulating votes in large cities with nonwhite populations in otherwise largely white swing states — has been orthodoxy among top Republican officials for more than a decade.

The Justice Department under George W. Bush was obsessed with voter fraud. John Ashcroft, the attorney general, lost his Missouri Senate race after a day of electoral chaos in which Democrats tried to keep polling places open in St. Louis for a few extra hours so that voters improperly purged from registration lists or forced to wait in long lines could vote. Missouri Republicans accused St. Louis Democrats of trying to steal the election. Missouri Sen. Kit Bond asked the FBI to investigate "a major criminal enterprise designed to defraud voters."

No evidence of such a conspiracy in Missouri ever emerged. But the Justice Department considered voter fraud such a pressing threat that it spent five years investigating and prosecuting cases. In what became a major political scandal, eight US attorneys were fired for political reasons, including what was seen as insufficient zeal in prosecuting voter fraud.

Karl Rove, Bush’s top political mastermind, warned frequently of voter fraud: “We are, in some parts of the country, I'm afraid to say, beginning to look like we have elections like those run in countries where the guys in charge are, you know, colonels in mirrored sunglasses,” he told the Republican National Lawyers Association in 2006. “I mean, it's a real problem.”

The result of all of this, the New York Times reported in 2007, was that the Justice Department investigated about 120 people, 86 of whom were convicted. Many of them appeared to have made honest mistakes, such as registering to vote despite not being citizens because they were renewing their driver’s license, or voting while on probation. Other investigations found equally low rates of in-person voter fraud.

But the utter lack of evidence for a massive conspiracy didn’t stop Republicans from continuing to accuse Democrats of trying to perpetrate one.

In 2012, Republican National Committee chair Reince Priebus claimed that voter fraud was so rampant in Wisconsin, in particular in Milwaukee (like Philadelphia and St. Louis, a city with a significant black population in a state that’s otherwise largely white), that Republicans needed to do “a point or two better” than they otherwise would to overcome it.

When Trump claims that dead people are going to vote or living people are going to assume new identities in order to vote multiple times, he’s saying the same thing Republican officials have been saying for years. When he asks supporters to sign up to be “poll watchers,” he’s doing the same thing the Republican Party tried to do in Ohio in 2004, when party officials planned to challenge voters’ registrations, particularly in nonwhite areas. (The plan was later abandoned.)

When Trump claims that the nation is about to see unprecedented levels of voter fraud, he’s not going much further than McCain, who said at the final debate of the 2008 election that ACORN, through fraudulent voter registration, was “now on the verge of maybe perpetrating one of the greatest frauds in voter history in this country, maybe destroying the fabric of democracy.”

An ad from the Palin-McCain campaign accused ACORN of “massive voter fraud” and said that “the Obama campaign paid more than $800,000 to an ACORN front for get-out-the-vote efforts.” Trump breaks with Republican orthodoxies on all kinds of issues. But his rhetoric on voter fraud is firmly in the mainstream.

How charges of “voter fraud” rig the system — against Democrats

The difference between Trump’s warnings about election fraud and those in the past from other prominent Republicans, such as McCain, is that Trump seems to actually believe them.

If McCain really, sincerely believed ACORN had stolen the election with help from get-out-the-vote money from the Obama campaign, he would not have given a gracious concession speech on election night. But he did. Making an ad about ACORN’s ties to Obama made his opponent look shady, but in the end, accusations of voter fraud were a useful political tool before the election, not a serious reason to dispute its results.

Republicans often use worries about voter fraud to take steps that make it harder for traditionally Democratic voters to vote. In the 1980s, the Republican National Committee was sued for trying to intimidate voters of color by challenging their registrations or posting off-duty police officers at polling places.

Voter fraud is the raison d’être for groups like True the Vote, a group founded by a Tea Party activist that challenges voter registrations, often from low-income or minority households. Laws requiring voters to show identification at the polls disproportionately stop Democratic voters from showing up, a 2015 study from political scientists at the University of California San Diego found.

Election officials end up “chasing chimeras”

The Republican lawmakers who make these laws are well aware of their political effect. A federal appeals court found that North Carolina lawmakers crafted the voter ID law in that state in order to prevent African Americans from voting. In Pennsylvania in 2012, a Republican lawmaker celebrated a voter identification law in that state, saying it would deliver its Electoral College votes to Romney.

The great irony of voter fraud rhetoric is that Republican accusations that Democrats are rigging the election are often used to pass measures or pursue strategies that make it harder for Democrats to vote and easier for Republicans to win — measures that make the playing field less even.

There’s also a second, more subtle way the voter fraud rhetoric disenfranchises people, Charles Stewart, a political scientist at the Massachusetts Institute of Technology who has studied how partisanship affects the public’s view of election outcomes, said.

The obsession with voter fraud means that election officials end up “chasing chimeras,” problems with no evidence that they actually exist, rather than dealing with the actual barriers to voting and representation.

And there are plenty of those, Stewart said: long lines, poorly maintained polling places, inadequate outreach to younger voters who need to get registered and to the polls. “The real challenges of election administration are substantial,” he said. “They don’t get to the level yet of undermining the system, but if we don’t focus on the real problems, we’re chasing chimeras.”

Solving those problems, though, involves measures, such as automatic registration, that some Republicans oppose — because some believe it will increase voter fraud.

Why Trump is arguing that the election is rigged

Trump presents himself as a winner who can make America win again. Losing embarrassingly and publicly, as he currently is, is a threat not just to the central argument of his campaign but to his entire persona. Every time Trump has fallen behind, he’s seized on the same excuse: If he’s not winning, it’s because there’s something wrong with the game.

After Ted Cruz won Colorado’s caucuses in April, Trump called them “rigged and boss-controlled.” Over the summer, he began to issue dire warnings that the general election wouldn’t be fair, either. “The elections are rigged,” he said on August 1, when he was falling in the polls after picking a fight with the Muslim parents of Humayun Khan, a fallen American soldier.

With three weeks to go before Election Day, Trump’s accusations that the system is rigged are getting more specific. Voter fraud, he says, is “very, very common.” Nearly 2 million dead people, he claims, are going to vote for Hillary Clinton. In August, he warned that people were going to “vote 10 times” if they weren’t required to provide identification.

None of this is true. In-person voter fraud — showing up at the polls and claiming to be a dead person, or establishing multiple identities in order to vote 10 times — is vanishingly rare. Justin Levitt, a professor at Loyola Law School in Los Angeles, has tracked allegations of voter fraud since 2000 and found only 31 reports, out of billions of ballots cast over more than a dozen years, of the kind of fraud that Trump is talking about.

Crying election fraud gives Trump someone to blame other than himself. Claiming the election has been stolen from him makes him an aggrieved victim of injustice, rather than just a loser, on November 9.

But it’s quite possible that Trump really believes what he’s saying. He is the first Republican nominee to have absorbed the messages of conservative media before he understood their broader strategic utility. Other Republicans use Fox News strategically to appeal to their base; Trump actually drank the Kool-Aid. It’s why he brings up obscure figures, such as MIT health economist Jonathan Gruber or Clinton confidant Sidney Blumenthal, during a town hall debate. Gruber and Blumenthal aren’t household names — except on cable news, which Trump clearly reveres as a source of information.

Trump’s belief that Democrats were stealing elections also predated his fall in the polls. In 2012, as election results were rolling in showing that Romney had lost, Trump fired off an angry tweetstorm. “He lost the popular vote and won the election,” Trump tweeted, adding a bit later: “More votes equals a loss … revolution!”

Those tweets — unusually, for Trump — have since been deleted, but others are still online:

Lets fight like hell and stop this great and disgusting injustice! The world is laughing at us. — Donald J. Trump (@realDonaldTrump) November 7, 2012

This is the broader context in which Trump is making his remarks. Political partisans generally are less likely to trust the electoral system when they lose. And for years, Republicans have stoked fear that nonwhite voters are rigging the system and stealing votes that should be rightfully theirs. The flames of conspiracy have already been burning on the fringe of the party. A losing candidate who refuses to concede could whip them up into a wildfire.

Why Trump’s embrace of voter fraud conspiracies could be dangerous

There is simply no evidence that voter fraud is widespread enough to affect the outcome of a presidential election. Still, even before Trump started spreading his conspiracy theories, Republicans’ confidence in election fairness was dropping precipitously.

If Trump loses on Election Day and accuses Hillary Clinton of stealing an election that was rightfully his, he’ll find a receptive audience. Even if Clinton wins in a landslide, research suggests that if Trump doesn’t concede, it could change how voters see the outcome.

Only about half of Trump supporters are at least “somewhat” confident that votes will be counted fairly, the Pew Research Center found in August. The share of Americans who lack confidence in a fair count has more than doubled since 2004. In a post-election survey, 31 percent of voters who chose Mitt Romney in 2012 said there was “a lot of fraud” and that “the man with the most votes was denied the presidency” — in other words, that Obama stole the election.

Obama’s victory in 2012 wasn’t a landslide. But it was decisive; he won by nearly 5 million votes, and only one swing state, Florida, was even particularly close. Stewart theorizes that the close election in 2000 primed Americans to believe that a small handful of voters, and thus a small amount of fraud, can change the course of history, even though this is rarely the case.

“People were encountering humanity, and they were shocked”

But white Americans are also quick to decide that votes from people of color are illegitimate. In 2008, Stewart surveyed voters to ask if they’d been intimidated at the polls, among other questions. Only 1 percent said they had, and he asked them to describe what had happened.

“A shocking number of people said, ‘I was intimidated by black people being at the polls,’” he said. Almost no one was intimidated in a legal sense: “Mostly people were encountering humanity, and they were shocked by what they saw among their neighbors.” Implicit bias, or often subconscious prejudices, also played a role, he concluded: “You see people voting who aren’t like you,” he said, and voters think, “How can this be? I don’t run into people like this all the time; these must not be legitimate voters.”

But voters who watch Fox News or listen to talk radio, beyond their personal experiences at the polling places, have also heard a stream of stories about voter fraud and illegitimacy. The statistics suggest that some of those narratives have taken hold.

A Morning Consult poll suggests that so far, that Trump’s complaints about a rigged election have mostly shored up Democrats’ faith in the electoral process rather than caused Republicans to doubt it more than they already did.

But on election night, Trump won’t only be preaching to the converted. For a study published in 2012, two political scientists, Greg Vonnahme and Beth Miller, asked a group of college students to read about two fictional candidates for the House of Representatives and to pick one to support. Then students were told that the candidate they supported had lost, either by a wide margin or a small one. Some students were told the candidate had accepted the result and conceded, while others were told the candidate had questioned the results.

The students whose candidates did not gracefully concede defeat were more likely to doubt that the election was fair, that votes were counted accurately, and that the candidate who go the most votes won. Troublingly, students had the same amount of confidence in a close election where the winner conceded as they did in a landslide. What mattered didn’t appear to be the margin of victory but rather the loser’s reaction.

2016 could be the first time in a long time when the loser of an election refuses to admit he’s lost. Trump, after all, is a winner. And if he maintains that line after the election, the experiment Vonnahme and Miller did suggests something scary about American democracy: One of the most important duties of a loser is to admit that he lost.

Trump has spent years absorbing conservative media, enough to pepper speeches to a general audience with references to controversies and characters familiar only to Fox News watchers. He is the first Republican nominee who has unquestioningly drunk the conservative media Kool-Aid. What’s scaring Republican officeholders isn’t that Trump is making allegations of voter fraud. It’s that he wholeheartedly believes them.