Socialism is stubborn. After decades of dormancy verging on death, it is rising again in the west. In the UK, Jeremy Corbyn just led the Labour party to its largest increase in vote share since 1945 on the strength of its most radical manifesto in decades. In France, the leftist Jean-Luc Melenchon recently came within two percentage points of breaking into the second round of the presidential election. And in the US, the country’s most famous socialist – Bernie Sanders – is now its most popular politician.

The reasons for socialism’s revival are obvious enough. Workers in the west have seen their living standards collapse over the past few decades. Young people in particular are being proletarianized in droves. They struggle to find decent work, or an affordable place to live, or a minimum degree of material security. Meanwhile, elites gobble up a growing share of society’s wealth.

But grievances alone don’t produce political movements. A pile of dry wood isn’t enough to start a fire. It needs a spark – or several.

For the resurgent left, an essential spark is social media. In fact, it’s one of the most crucial and least understood catalysts of contemporary socialism. Since the networked uprisings of 2011 – the year of the Arab spring, Occupy Wall Street and the Spanish indignados – we’ve seen how social media can rapidly bring masses of people into the streets. But social media isn’t just a tool for mobilizing people. It’s also a tool for politicizing them.

Social media has supplied socialists with an invaluable asset: the building blocks of an alternative public sphere. The mainstream media tends to be hostile to the left: proximity to power often leads journalists to internalize the perspectives of society’s most powerful people. The result is a public sphere that sets narrow parameters for permissible political discourse, and ignores or vilifies those who step outside of them. That’s why social media is indispensable: it provides a space for incubating new kinds of political thinking, and new forms of political identity, that would be inadmissible in more established channels.

Every movement needs a petri dish for developing the specific contagion with which it hopes to infect the body politic. The Reformation had the printing press. The French revolution had the coffeehouse. Today’s new new left has Twitter and Facebook.

Labour supporters at a campaign visit in Colwyn Bay, north Wales, on the eve of the general election. Photograph: Oli Scarff/AFP/Getty Images

Last month’s election in the UK offered a stark illustration of this dynamic. Much of the British media attacked Corbyn relentlessly in the weeks leading up to the election. An analysis from Loughborough University found that Labour received the vast majority of the negative coverage, while a study from the London School of Economics concluded that Corbyn had been the victim of “a process of vilification”.

In another era, such an assault might’ve proven fatal. Fortunately, social media gave Corbyn’s supporters a powerful weapon. Banished from the public sphere, they built one of their own. They didn’t merely use social media – judging by the number of tweets and Facebook engagements, they dominated it. Pro-Labour memes, slogans, videos and articles saturated online networks. Some were funny, such as a viral video of Corbyn extemporaneously eating a Pringle. Others were serious, drawing on independent leftwing outlets such as Novara Media to advance an analysis of austerity’s corrosive effects on British society. Together they made millions of people feel connected to a common project. They made Corbynism feel like a community.

corbyn ate a pringle tonight pic.twitter.com/MA5pnBJi0M — melancholy egg yolk (@ggeordiebore) May 31, 2017

Crucially, this community didn’t just exist online. Contrary to the old refrain about the internet not being “real life”, the digital ferment paid analog dividends. Young people – the heaviest users of social media – turned out in greater numbers than usual, and they voted overwhelmingly for Labour.

What’s so bracing about the British election is how many elite assumptions it overturned. These include the belief that social media is bad for democracy. The notion that Twitter and Facebook play a toxic role in our political life has become a pillar of elite opinion in the era of Brexit and Trump. It’s a familiar argument: online platforms deepen polarization by enclosing us in echo chambers where we’re only exposed to views we already agree with. Partisanship flourishes. Compromise becomes impossible.

The French Revolution had the coffeehouse. Today’s new new left has Twitter and Facebook

This analysis has some truth to it, but largely misses the mark. There’s no doubt that social media can be a cesspool. It can spread misinformation, abuse and all manner of extremist hatred. After all, social media’s defining trait is its capacity to connect like-minded people. It follows that the communities it creates vary widely by the kind of people being connected.

But this aspect of social media is also what makes it useful for today’s socialists. Bubbles can be beneficial. They can provide an emerging movement with a degree of unity, a sense of collective identity, that helps it cohere and consolidate itself in its fragile early phases.

Of course, movements can’t stay bubbles if they want to win. They have to move from the margins to the mainstream. But social media is the soil where they can begin to take root, where they can cultivate a circle of allies and agitators who will carry their ideas out into the wider world. And this is good for democracy, because it enables genuinely popular political alternatives to emerge. It weakens the power of elites to police the limits of political possibility, and amplifies voices that could not otherwise make themselves heard.

Instead of sealing people off into echo chambers, social media can serve as a stepping stone for movements that aspire to achieve mass appeal. Just because social media helps midwife a movement doesn’t mean that movement is fated to insularity. Labour began its campaign trailing the Tories by more than 20 points. In seven short weeks, the party’s activists pulled off the most dramatic turnaround in modern British history. Powered in large part by social media, they closed the gap quickly enough to wipe out the Conservative majority. Labour now enjoys an eight-point lead in the polls – a stunning reversal from a few months ago.

‘A pile of dry wood isn’t enough to start a fire. It needs a spark’ ... Bernie Sanders supporters at a campaign rally. Photograph: Robyn Beck/AFP/Getty Images

If polarization were as absolute as many mainstream observers believe, such an upset would be impossible. But political preferences are far more fluid than is often assumed. Many people are up for grabs, especially at a time when anti-establishment feeling is running high. As a result, social media doesn’t necessarily strengthen existing partisan divisions. It can also scramble them, by surfacing new political possibilities. This is especially helpful in luring the large numbers of non-voters to the polls. It’s no coincidence that the British election saw the highest turnout in 25 years.

The prospects for turnout-driven victories are even greater in the US, where political alienation is particularly pronounced. Only 55.7% of the voting-age population cast ballots in the last presidential election. Given these numbers, the model of an electorate split down the middle, locked into their irreconcilable Facebook feeds, is misleading. You can’t have a country divided in half when half the country doesn’t vote.

These are the people that the rising American left must win if it wants to replicate the success of its British comrades. Non-voters already form a natural constituency for progressive politics: they tend to be younger and poorer, and broadly support redistributive policies. But organizing this silent social-democratic majority will require more partisanship, not less.

Tepid centrism will not politicize people who believe that politics has nothing to offer them. Only a strongly defined alternative can. Social media offers a way to articulate that alternative, and to push it into public view. Tweets alone won’t put socialists in power. But given the scale of the left’s ambition, and the obstacles arrayed against it, they’re not a bad place to start.