Every generation has its go-to pop-culture political analogy. For decades, it was Star Wars. It’s easy to see how Reagan’s 80s space-based weapons shield initiative earned its nickname, for example, but the reference has endured, to the extent that White House chief strategist Steve Bannon expressed his admiration for the dark side in a recent interview: “Darkness is good. Dick Cheney, Darth Vader, Satan. That’s power.” But one name was missing from that list: Voldemort.

The Harry Potter villain has risen again over the past couple of years, as fans have drawn comparisons, often humorously, between a world under threat from a narcissistic autocrat and that of the Harry Potter books. In February, Bannon was the subject of a Buzzfeed quiz that asked, Who Said It: Steve Bannon or Lord Voldermort?; it was harder than you might have thought. JK Rowling’s readers have grown up at roughly the same pace as Harry, Ron and Hermione, and with its hundreds of millions of book sales and the massive success of the film adaptations, the series’ reach has been enormous.

What Harry Potter has given a generation is a simple tale of good triumphing over evil, and, as a result, it has been a frequent and controversial point of reference in these times of political divisiveness. At the worldwide Women’s Marches in January, there were plenty of homemade signs that showed Princess Leia as the face of a new resistance, but there were as many Potter ones, such as “Dumbledore’s army”, inspirational quotes from the series and references to Hermione’s role in Harry’s survival. Perhaps these placards had been inspired by an outpouring of affection for the books following the US election in November, as people began to post quotes on Twitter. “Order of the Phoenix, mount up,” wrote Hamilton creator Lin-Manuel Miranda. There is even a Chrome extension that changes any mention of Donald Trump or his cabinet to the name of a notable Death Eater. Install it, and your browser will instantly refer to Betsy DeVos as Dolores Umbridge, Jeff Sessions as Antonin Dolohov or Rex Tillerson as Draco Malfoy.

Facebook Twitter Pinterest Placards at the Woman’s March in Washington DC. Photograph: Patsy Lynch/REX/Shutterstock

“I would have been nine or 10 when I started reading it,” says Jamie MacColl, 26, the guitarist in Bombay Bicycle Club. Last year MacColl set up the campaign group Undivided, which aims to ensure young people’s voices are heard in Brexit negotiations, and he recently appeared on the BBC Question Time panel. “I remember the frenzy to read each new book within minutes of it coming out, and queueing up in the middle of the night at the bookshop to get it.” He says that he can only think of their political or social message in light of JK Rowling’s transparently left-leaning Twitter presence. “I think she has a similar kind of politics to me. But one of the things that struck me at the time was that it didn’t matter who you were. Hermione had no wizard blood and was by far the most capable.”

The broad central message of the Potter books is diversity and acceptance of difference. As the characters grow older, and the books more complex and mature, the political consequences of not heeding this doctrine become darker and more menacing. The baddies’ insistence on the superiority of purebloods over mudbloods has overtones of ethnic cleansing; the Death Eaters are fascistic. It would be mean-spirited to spoil the carefully guarded plot of The Cursed Child for those with tickets to see it, but it is fair to say that there is plenty in the play that makes this association clear.

It’s a lot of fun to update the references and see how Rowling’s vision works for the current era. Throughout the series, the Ministry of Magic is full of incompetent, corrupt, bumbling figures whose only ambition is to cling on to power. The press is untrustworthy and hysterical. In a magical premonition of phone-hacking, the journalist Rita Skeeter transforms herself into a beetle in order to report on details nobody else could know about. The Daily Prophet is often used as a puppet of the system in order to sway popular views. About the recent Potter prequel Fantastic Beasts and Where to Find Them, Rowling said, “I was partly inspired by the rise of populism around the world.” The explanation of the anti-magic sentiment rippling through 1920s New York in the film could be taken from Brexit Britain: “When ‘No-Majs’ [American for muggle] are afraid, they attack.”

Facebook Twitter Pinterest Steve Bannon, who recently said: ‘Darkness is good. Dick Cheney, Darth Vader, Satan. That’s power.’ Photograph: REX/Shutterstock

In 2013, Anthony Gierzynski, a professor of political science at the University of Vermont, published a study called Harry Potter and the Millennials: Research Methods and the Politics of the Muggle Generation, co-authored with Kathryn Eddy. It aimed to answer the question of whether the Harry Potter story had influenced the politics of millennials. In the introduction, Gierzynski discusses, with what now looks like quaint naivety, online comparisons that at the time variously likened Voldemort to Rick Perry and Dick Cheney.

“To say the political landscape has changed is an understatement,” he tells me. “We have a president whose rhetoric promotes intolerance and who fits the typical authoritarian personality. I would think the Harry Potter lessons are even more relevant today than they were for the 2012 election.”

Rowling herself nodded to a Trump/Voldemort comparison back in 2015, when Trump first proposed a ban on Muslims entering the US. “How horrible. Voldemort was nowhere near as bad,” she tweeted. The link has been made by others, and often; there are countless memes comparing the president to He Who Must Not Be Named. (Intriguingly, when criticising Trump in recent speeches or interviews, celebrities such as Meryl Streep and Kristen Stewart have declined to address him by name, a stance shared with many US activists.)

In the case of Trump, Gierzynski suggests, a better reference point would be an incompetent Ministry of Magic, Cornelius Fudge-type figure. But he also points out that throwing names around is unlikely to be helpful in the long run. “Calling anyone Voldemort is problematic in terms of the debate you might have. It shuts down the debate,” he says. “If you have a discussion [about] what happens with these kinds of leaders, and how this leads to an intolerance of ‘out groups’ – that is where the value of the Harry Potter series is, to me. It can provide lessons about how you deal with that sort of injustice and intolerance.”

In 2016, Diana Mutz, professor of political science at the University of Pennsylvania and director of the Institute for the Study of Citizens and Politics, published a paper called Harry Potter and the Deathly Donald, which cautiously argued that reading Harry Potter or watching the films lowered Americans’ opinions of Trump and his policies. “Stories can sway people’s views; Harry Potter is just one that happens to have been read and viewed by a massive number of people. This makes it potentially more influential than most stories,” she tells me by email. “Fictional stories are more than just analogies; they are a time-honoured way of influencing opinions. Think of Uncle Tom’s Cabin and American attitudes towards slavery.”

Facebook Twitter Pinterest Michael Gambon as Dumbledore. Photograph: Warner Bros/Sportsphoto/Allstar

Like Gierzynski, Mutz suggests that the messages of tolerance and diversity in the Harry Potter world have influenced the beliefs of its readers, rather than reflecting an existing point of view. But she was surprised by the strength of the backlash she received upon publication of the paper. “I have never received more hate mail than in response to this study; it’s a bit scary, to be honest. Clearly, people who like Donald Trump are uncomfortable with the study’s findings, but with empirical data, you don’t get to choose your findings. They are what they are,” she says. (The current climate is so toxic that Gierzynski also expressed concern. “There’s a bit of fear in our discourse. Usually, when I talk to journalists, I wouldn’t worry, but these days I do.”)

Trump supporters are not alone in criticising the use of Harry Potter as a political analogy. In a scathing post-election column for Esquire last November, Corey Atad wrote that even though he considers himself to be an “enormous Harry Potter fan”, he found the comparison of Trump to Voldemort, and the idea of an opposition that is Dumbledore’s army, to be repellent. “In tweet after shameful tweet, intellectually and emotionally stunted adults sought to place the election of a fascistic president in terms they could easily understand,” he wrote. The Huffington Post ran a story that called Trump/Voldemort comparisons “inane and condescending”, while Matthew Dessem, a writer for Slate, was similarly outraged: “Are you fucking kidding me with this shit? ... This is really happening.”

All three pieces were written in the immediate aftermath of the election; the anger and fear is palpable and understandable. But the idea of using fictional stories to understand and interpret the world is as old as time; it is no coincidence that sales of Nineteen Eighty-Four and The Handmaid’s Tale have soared since November. If, as academics such as Mutz and Gierzynski contend, the Harry Potter series has created a generation of people who are more open-minded and tolerant of difference owing to the books they read as children, then it seems far from juvenile and reductive.

Besides, there is little to suggest that tweeting a Dumbledore quote is as far as a Potter fan might take it. In June last year, Yeni Lopez Sleidi, the editor of the site wwwayward, made posters of Donald Trump underneath a motivational quote: “There is no good and evil, there is only power, and those too weak to seek it.” Potter fans may recognise these words as belonging to Professor Quirrell, remembering what the Dark Lord taught him. Sleidi sold a number of posters to Trump supporters and donated the profits to Familia: Trans Queer Liberation Movement, a charity that supports LGBTQ Latino communities. If the buyers had put the posters on their walls and turned off the lights, they would have found that their purchase had a secret: in the dark, Trump disappears, to be replaced by a glowing green image of Voldemort. Now that’s magic.