We are swimming in writing. Our lives have become, in the words of the author and academic Shoshana Zuboff, an “electronic text”. Social media platforms have created a machine for us to write to. The bait is that we are interacting with other people: our friends, colleagues, celebrities, politicians, royals, terrorists, porn actors – anyone we like. We are not interacting with them, however, but with the machine. We write to it, and it passes on the message for us after keeping a record of the data.

The machine benefits from the “network effect”: the more people write to it, the more benefits it can offer, until it becomes a disadvantage not to be part of it. Part of what? The world’s first ever public, live, collective, open-ended writing project. A virtual laboratory. An addiction machine, which deploys crude techniques of manipulation redolent of the Skinner Box created by behaviourist BF Skinner to control the behaviour of pigeons and rats with rewards and punishments. We are users, much as cocaine addicts are users.

What is the incentive to engage in writing like this for hours each day? In a form of mass casualisation, writers no longer expect to be paid or given employment contracts. What do the platforms offer us, in lieu of a wage? What gets us hooked? Approval, attention, retweets, shares and likes.

This is the Twittering Machine: not the infrastructure of fibre-optic cables, database servers, storage systems, software and code. It is the machinery of writers, writing and the feedback loop they inhabit. The Twittering Machine thrives on its speed, informality and interactivity. The protocols of Twitter itself, for example, encourage people to post quickly and often. The feed has an extremely rapid turnover, so that anything posted will, unless it “goes viral”, tend to be quickly forgotten by most followers. The system of followers, @ing and threading encourages sprawling conversations to develop from initial tweets, favouring constant interaction. This is what people like about it, what makes it engaging: it is like texting, but in a public, collective context.

Meanwhile, hashtags and trending topics underline the extent to which all of these protocols are organised around the massification of individual voices – a phenomenon cheerfully described by users with the science-fiction concept of the “hive mind” – and hype. The regular sweet spot sought after is a brief period of ecstatic collective frenzy around any given topic. It doesn’t particularly matter to the platforms what the frenzy is about: the point is to generate data, one of the most profitable raw materials yet discovered. As in the financial markets, volatility adds value. The more chaos, the better.

Whether or not we think we are addicted, the machine treats us as addicts. Addiction is, quite deliberately, the template for our relationship to the Twittering Machine. Addiction is all about attention. For the social media bosses, this is axiomatic.

If social media is an addiction machine, the addictive behaviour it is closest to is gambling: a rigged lottery. Every gambler trusts in a few abstract symbols – the dots on a dice, numerals, suits, red or black, the graphemeson a fruit machine – to tell them who they are. In most cases, the answer is brutal and swift: you are a loser and you are going home with nothing. The true gambler takes a perverse joy in anteing up, putting their whole being at stake. On social media, you scratch out a few words, a few symbols, and press send, rolling the dice. The internet will tell you who you are and what your destiny is through arithmetic likes, shares and comments.

The interesting question is what it is that is so addictive. In principle, anyone can win big; in practice, not everyone is playing with the same odds. Our social media accounts are set up like enterprises competing for attention. If we are all authors now, we write not for money, but for the satisfaction of being read. Going viral, or trending, is the equivalent of a windfall. But sometimes, winning is the worst thing that can happen. The temperate climate of likes and approval is apt to break, lightning-quick, into sudden storms of fury and disapproval.

A 2015 study looked into the reasons why people who try to quit social media fail. The survey data came from a group of people who had signed up to quit Facebook for just 99 days. Many of these determined quitters couldn’t even make the first few days. And many of those who successfully quit had access to another social networking site, like Twitter, so that they had simply displaced their addiction. Those who stayed away, however, were typically in a happier frame of mind and less interested in controlling how other people thought of them, thus implying that social media addiction is partly a self-medication for depression and partly a way of curating a better self in the eyes of others. Indeed, these two factors may not be unrelated.

For those who are curating a self, social media notifications work as a form of clickbait. Notifications light up the reward centres of the brain, so that we feel bad if the metrics we accumulate on our different platforms don’t express enough approval. The addictive aspect of this is similar to the effect of poker machines or smartphone games, recalling what the cultural theorist Byung-Chul Han calls the “gamification of capitalism”.

But it is not only addictive. Whatever we write has to be calibrated for social approval. Not only do we aim for conformity among our peers but, to an extent, we only pay attention to what our peers write insofar as it allows us to write something in reply, for the likes. Perhaps this is what, among other things, gives rise to what is often derided as virtue-signalling, not to mention the ferocious rows, overreactions, wounded amour-propre and grandstanding that often characterise social media communities.

The analogy between the gambler and the social-media junkie is hard to avoid. Tristan Harris, Google’s former design ethicist, calls your smartphone “The Slot Machine in Your Pocket”. Most smartphone apps use “intermittent variable rewards” to keep users hooked. Because rewards are variable, they are uncertain: you have to pull the lever to see what you are going to get. Adam Alter adds that, with the invention of the like button, users are gambling every time they post. The anthropologist Natasha Dow Schüll, based on her work on machine gambling, agrees.

Today’s casinos are very different from the macho dice-and-card play organised by old-school crime bosses. At the roulette table, the gambler could justify his perverse pleasure in risk-taking as a matter of honour in competition with peers. In recent decades, however, the favoured form has moved from the table to the slot machine. And the slot machines – digital and complex – have come a long way from the days of the one-armed bandit. Now, the gambler experiences no macho showdowns, just an interactive screen offering multiple permutations of odds and stakes, deploying user-experience design techniques similar to video games to induce pleasure.

The machines have a range of devices to give users the appearance of regular wins to keep them playing. These are often losses disguised as wins, insofar as the payoff is less than the cost of playing. But the wins are not even the goal of playing. When we are on the machine, Schüll finds, our goal is to stay connected. As one addict explains, she is not playing to win but to “stay in that machine zone where nothing else matters”. The gambling industry recognises this desire to avoid social reality. It is called “time on device”, and everything about the machine is designed to cultivate it.

Time on device pinpoints something crucial about addiction. Traditionally, casinos have blocked out daylight and banned anything that conveys the sense of time passing: there are no windows or clocks and, rather than timed meals, there is a constant supply of refreshments. Some gambling-machine addicts today prefer to urinate in a paper cup rather than leave the device. Pubs and opium dens also have a history of blotting out daylight to allow users to enjoy themselves without the intrusion of time. The sense of dropping out of time is common to many addictions. As one former gambling addict puts it: “All I can remember is living in a trance for four years.” Schüll calls it the “machine zone”, where ordinary reality is “suspended in the mechanical rhythm of a repeating process”. For many addicts, the idea of facing the normal flow of time is unbearably depressing. Marc Lewis, a neuroscientist and former heroin addict, describes how even after kicking the drug, he couldn’t face “a day without a change of state”.

The Twittering Machine, as a wholly designed operant conditioning chamber, needs none of the expedients of the casino or opium den. The user has already dropped out of work, a boring lunch or an anxious social situation to enter into a different, timeless zone. What we do on the Twittering Machine has as much to do with what we are avoiding as what we find when we log in – which, after all, is often not that exciting. There is no need to block out the windows, because that is what the screen is already doing: screening out daylight.

And it manages time differently. For gamblers, the only temporal rhythm that matters is the sequence of encounters with destiny, the run of luck. For drug users, what matters is the rhythms of the high, whether it is the stationary effect of opium or the build, crescendo and crash of alcohol. The experience of platform users, on the other hand, is organised in a trance-like flow. The user is plunged into a stream of real-time information and disciplined to stay constantly ahead of it. Twitter highlights not the time and date of posts, but their age and thus currency: 4m, or 12h, as the case may be.

The ensuing trance-like state, according to the digital theorist David Berry, is remarkably similar to what in early stock markets was called the “ticker trance”. Financial speculators would become absorbed in watching the signals conveyed on stock market ticker tape, vigilant to every minute variation in a real-time flow. That is to say the timestamp, like the coded information on the ticker tape, is information about the state of the game. It enables users to place an informed bet.

If social-media platforms are like casinos, then they build on the existing extension of gambling in the neoliberal era. Whereas gambling was controlled in a paternalistic way in the postwar era, laws have been increasingly liberalised in the past 40 years. Today, the majority of Britons gamble in some form, most commonly through the National Lottery. Similar transformations have taken place in the US and Canada, and the European Commission has pressured holdouts including Italy, Austria and France to liberalise.

All of this has taken place concurrently with waves of financial liberalisation, wherein capitalist dynamism was increasingly dependent on the bets and derivative bets of the stock market. And there is a logical convergence between financialisation and tech. The financial sector is the most computerised sector of capitalism, and the use of software for trading has resulted in numerous efforts to “game the system” – as in May 2010, when a trader’s use of algorithms to repeatedly spoof bets against the market some 19,000 times briefly caused a trillion-dollar crash.

Culturally, the idea of life as a lottery – one that only a few magical adepts know how to work – has gained widespread traction both as a folk social theory and as an explanation for human misfortune. This links gambling to destiny and divine judgment in a way that reaches back to its earliest expressions. As the late literary scholar Bettina Knapp explained, the use of gambling as a divinatory device, as a way to work out what the supreme being wants of us, has been found in Shintoism, Hinduism, Christianity and the I Ching. At several points in the Bible, the drawing or casting of lots is used to discern divine will. In essence, the lot or die is a question about fate, posed to a superpower. Something similar happens when we post a tweet or a status or an image, where we have little control over the context in which it will be seen and understood. It is a gamble.

The cliche holds that the social media platforms administer social approval in metrically precise doses. But that is like treating gambling as if it were only about the payoffs. Every post is a lot cast for the contemporary equivalent of the God of Everything. What we are really asking for when we post a status is a verdict. In telling the machine something about ourselves, whatever else we are trying to achieve, we are asking for judgment. And everyone who places a bet expects to lose.

For all the obsession with gratification, the most obvious attribute of addiction in its negative sense is that it kills. And nor is this a purely physical death. The drug addicts of Vancouver’s Hastings Corridor, described by Bruce Alexander – an emeritus professor of Simon Fraser University in British Columbia who has studied addiction since the 70s – suffer symbolic death, “sodden misery”, before their biological death from overdose, suicide, Aids or hepatitis. Compulsive gamblers administer death in a symbolic sense, too, building up unpayable debts to the point where they lose everything they have lived for.

Social-media addiction is rarely understood in this extreme light. Nonetheless, users often describe it wrecking their careers and relationships. The complaints are almost always the same: users end up constantly distracted, unproductive, anxious, needy and depressed – yet also curiously susceptible to advertising. Patrick Garratt wrote of his social media addiction causing a “desperate, hollow pressure of waste” in his working life as a journalist. Social-media addiction has been linked, repeatedly, to increased depression: interaction with the platforms correlates with a major decline in mental health, while increased screen time (or “time on device”) may be contributing to a recent surge in teen suicides. Facebook’s own guileful way of presenting the issue was to claim that while “passive” consumption of social media content could pose mental health risks, more engagement could “improve wellbeing”. This claim, while not supported by the research, would mean more profitable data for the site.

The dominant view of these self-destructive propensities was vividly explained by addiction entrepreneur, the late Allen Carr. In a macabre image, he compared addiction to a carnivorous pitcher plant. The plant lures insects and small animals to their death with the fragrant smell of nectar. Once the creature is inside, gazing down at that delicious pool of sugary liquid, it finds the walls slippery and waxy, then slides down, with growing speed, falling into what it discovers is a watery grave. By the time it realises that the pleasure is a mirage, it is too late to escape, and it is consumed by digestive enzymes. This was Carr’s hard sell – one of a range of powerful suggestion techniques he used to break his clients’ addictions. But it also condenses how we tend to think of the dark side of addiction – as something that ambushes the user, lured by a simple promise of pleasure.

The problem is that widespread knowledge of the dangers of addiction does not stop it from happening. Likewise, we know by now that if social media platforms get us addicted, they are working well. The more they wreck our lives, the better they are functioning. Yet we persist. Some of this can be explained away by the manner in which addiction organises our attention. The platforms, like gambling machines, are experts at disguising losses as wins. These work thanks to an effect similar to that exploited by practitioners of “cold reading” and psychic tricks: we attend to the pleasurable hits and ignore the disappointing misses. We focus on the buzz of winning, not the cost of playing the game, and not the opportunities lost by playing. And if occasionally the habit threatens to crush us, we can fantasise that one day a big win will save us. But to explain away behaviour is not really to explain it. It is to collude in the rationalisation of behaviour that may not be rational.

The prevalence of addiction raises a troubling question: is self-destruction, in some perverse way, what we are seeking? What if we dive into the pitcher plant in part because we expect a slow death? What if, for example, the images of death and disease on the cigarette packet are an advertisement? Of course, it is not what is consciously sought. Heroin users are always trying to rediscover the bliss of the first hit. Compulsive gamblers live for those manic moments when their strategy seems to have paid off with a big win. But if it was really all about dopamine loops keeping us fixated on the next hit, it would be difficult to explain why random hits of unpleasure would make social media even more gripping. The platforms treat us mean and keep us keen.

One metric for this experience is known as “The Ratio”. On Twitter, if the replies to your tweet vastly outnumber the likes and retweets, you have gambled and lost. Whatever you have written is so outrageous, so horrible, that you are now in the zone of the shitstorm. The notorious examples of this involve corporate CEOs, politicians and celebrities, ostensibly on the medium for professional purposes, pushing the self-destruct button with an awful post. But the telling examples are not those tweets where there is a momentary lapse in good public relations, but those where intelligent users become embroiled in horrendous, undignified, self-destructive fights with their followers.

Consider, for example, Mary Beard, a Cambridge historian who maintains a profile on Twitter filled with amiable selfies, centre-left views and chat with fans. Beard’s downfall came as she mused publicly about the horrendous allegations of Oxfam aid workers raping and sexually exploiting children in Haiti. While stipulating that it could not be condoned, she wondered aloud how easy it would be to “sustain ‘civilized’ values in a disaster zone”. Beard’s progressive followers were horrified. She seemed to be relativising the behaviour of rapists. Would she be saying this, people wondered, if the victims were white? Beard was presumably unaware of any racist implication of her argument, but it was striking that she chose this medium as the place to make it. And perhaps just as significant was how ordinary that decision was. Twitter is good for witty banter; the lapidary concision of a tweet makes any putdown seem brutally decisive. Exactly for that reason, it is a terrible place to idly propose provocative theses.

In the ensuing shitstorm, blizzards of concise, lethal replies were launched in her direction. Disappointed followers declared their disaffection. Beyond a certain critical mass, it stopped mattering how accurate the criticisms were. The shitstorm is not a form of accountability. Nor is it political pedagogy, regardless of the high-minded intentions, or sadism, of the participants. No one is learning anything, except how to remain connected to the machine. It is a punishment beating, its ecstasies sanctioned by virtue. Twitter has, as part of its addictive repertoire, democratised punishment.

Rather than backing away from the medium in open-mouthed horror and reconsidering her whole approach to the issue, Beard remained entranced by the flow. As so many users have done, she spent hours upping the ante, trying to rebut, engage and manage the emotional fallout from the attack. She ended the day by posting a tearful photograph of herself, pleading with the medium that she was “really not the nasty colonialist you say I am”. This, predictably, egged the medium on, adding “white tears” and “white fragility” to the indictment. Hurt feelings, trivial in the scale of human woe, were being used to evade political accountability. (Besides, sotto voce, hurt feelings are delicious, but not enough.)

Still, Beard kept returning. It was, in its own way, a form of digital self-harm. The mirror that had told her how awesome she was now called her a scumbag, and it was clearly irresistible. Many online self-harmers set up anonymous accounts to bully themselves, a practice which among the “incel” (involuntarily celibate) community is known as “blackpilling”. On the Twittering Machine, no such efforts are needed. You just have to keep playing and wait for it. Come for the nectar of approval, stay for the frisson of virtual death.

Part of what keeps us hooked is the so-called variability of rewards: what the US computer scientist Jaron Lanier calls “carrot and shtick”. The Twittering Machine gives us both positive and negative reinforcements, and the unpredictable variation of its feedback is what makes it so compulsive. Like a mercurial lover, the machine keeps us needy and guessing; we can never be sure how to stay in its good graces. Indeed, the app manufacturers increasingly build in artificial-intelligence machine-learning systems so that they can learn from us how to randomise rewards and punishments more effectively. This sounds like an abusive relationship. Indeed, much as we describe relationships as having gone toxic, it is common to hear of “Twitter toxicity”.

Toxicity is a useful starting point for understanding a machine that hooks us with unpleasure, because it indexes both the pleasure of intoxication and the danger of having too much – hence the clinical term for the administration of toxic substances, toxicomania. The Renaissance natural philosopher Paracelsus is credited with a major insight of modern toxicology: the dose, not the substance, makes the poison. “Every food and drink, if taken beyond its dose, is poison,” he said.

If toxicity is having the wrong dose, what are we overdosing on? Even with drugs, the answer is not straightforward. As pointed out by Rik Loose, the author of The Subject of Addiction, similar quantities of the same drug administered to different individuals have widely varying effects. The real experience of the drug – the subject-effect, as it is called – partly depends on something other than the drug itself, namely something in the user. The happy pills have no more magic than magic beans. They have a blunt somatic force, but there has to be something else to act on. And if “psychosocial dislocation” was a sufficient cause, then there would be far more addicts. Beyond a certain point, addiction must act on, and be caused by, the psychic world of the user.

With social media addiction, there are many more variables than with drugs, so it is hard to know where to begin. The designers of the smartphone or tablet interface, for example, have made sure that it is pleasurable to engage with, hold, or even just to look at. The urge to reach, irritably, for the device during meals, conversations, parties and upon awakening, can partly be attributed to lust for the object and the soft, nacreous glow of the screen. Once we have navigated to the app, it is the platform designers who take control. For the duration of our visit, life is briefly streamlined, as with a video game, into a single visual flow, a set of soluble challenges, some dangled rewards and a game of chance. But the variety of possible experiences include voyeurism, approval and disapproval, gaming, news, nostalgia, socialising and regular social comparisons. If we are addicted, we might just be addicted to the activities that the platforms enable, from gambling to shopping to spying on “friends”.

Why Silicon Valley can’t fix itself

Read more

The platforms don’t organise our experience according to a masterplan. As the sociologist Benjamin Bratton puts it, the mechanism is “strict and invariable”, but within that “autocracy of means”, the user is granted a relative “liberty of ends”. The protocols of the platform standardise and order the interactions of users. They use incentives and choke points to keep people committed to the machine. They manipulate ends for the benefit of their real clients – other firms. They bombard us with stimuli, learning from our responses, the better to teach us how to be the market demographic we have been identified as. But they do not force us to stay there, or tell us what to do with the hours spent on the platform. Even more so than in the case of drugs, then, the toxicity is something we as users bring to the game.

• This article was amended on 23 August 2019 to correct the reference to the allegations against Oxfam aid workers.

This is an edited extract from The Twittering Machine by Richard Seymour, published by The Indigo Press. To order a copy for £11.43, go to guardianbookshop.com

•Follow the Long Read on Twitter at @gdnlongread, and sign up to the long read weekly email here.