Madness, Nietzsche wrote, is rare in individuals, but in groups it is the norm. Britain today is like a child that has been not only abandoned but literally dropped by its parents. It has broken into two different social groups, two politics, two worldviews but also, beneath the surface, two divergent ways of reorganising what psychoanalysts call an object world. (Object relations theory is Britain’s unique contribution to psychoanalysis.)

In England – the propulsive force behind Brexit – we are dealing with the psychology of a favoured, even chosen people. When ‘God is decreeing to begin some new and great period,’ Milton wrote in Areopagitica, ‘what does he then but reveal Himself … first, to his Englishmen?’ And in The Tenure of Kings and Magistrates, he wrote that ‘we have the honour to precede other nations who are now labouring to be our followers.’ During the centuries in which Britain maintained its global empire, this sense of being special did not rest on a simple identity. The British Empire looked alternately towards the European continent, where it sought to maintain the balance of power, and towards the seas, where it reigned supreme. This dual perspective began to weaken when a second type of empire – Ellen Meiksins Wood called it the empire of capital – replaced the earlier one, especially during the Thatcher years. With Brexit we are dealing not with empire and loss alone but with two different forms of empire: the older, racially organised, colonial empire and the newer, City-centred, Americanised empire.

The Tory Leave mentality that precipitated Brexit drew on the long-standing tradition of English exceptionalism. The best description I know of this mentality, Fintan O’Toole’s Heroic Failure, characterises it as ‘the transformation of a screw-up into a demonstration of character’. Examples include the Charge of the Light Brigade, Sir John Franklin’s doomed attempt to find the Northwest Passage in the 1840s, and Dunkirk. In each case, the British character is seen to rise above self-inflicted disaster through studied indifference, and thereby to manifest its inner superiority. Theresa May’s blind, stubborn, quasi-suicidal determination to enforce the referendum is another instance.

As O’Toole points out, stoicism and superiority in the realm of psychology is yoked to masochistic suffering in reality. That combination suited a society based on an organic division of labour between an aristocratic upper-class, which lived by honour, and submissive agricultural and industrial working classes, who suffered in silence. The Leave campaign echoed this old arrangement, as it brought together an un- or under-employed post-industrial working class – the so-called left-behinds – with insouciant upper-class Tories such as Boris Johnson or Jacob Rees-Mogg. One group, O’Toole notes, had nothing to lose while the other, whatever the outcome, would lose nothing. ‘The duty of the people of England when the honour of its rulers was at stake was always plain,’ O’Toole writes: ‘to suffer gloriously for as long as it took for the whole thing to peter out in exhaustion and futility.’

The mechanism underlying the cult of heroic failure is regression to narcissism. Just as a child trying to cope with his parent’s absence or the birth of a sibling may fall back on a supposed golden age in which ‘His Majesty, the Baby’ reigned, so too may a nation in difficulty seek to regain a storied past. In both cases the aim is to restore narcissistic equilibrium. The Leave slogan ‘Take Back Control,’ like Trump’s ‘Make America Great Again,’ reflects the idea that one moves forward only by passing through an earlier greatness. For the child this is the era of narcissistic plenitude. In politics, Boris Johnson sought to echo Milton, but that was a stretch. Milton was explaining why the English had found it necessary to execute a king, not why they couldn’t abide health regulations on their food supply or a ban on smoking in their pubs.

If the Leave campaign had its roots in the communal and aristocratic soil of England, the Remain campaign reflected the maritime dimension of British history, which culminates in the empire of capital, the City and the market. Remainers do not espouse heroic failure, but they share one element of it. The true point of heroic failure is to prove that even though you screwed up, you are still loved. Remainers are only superficially globalists or cosmopolitans, as comfortable in Tokyo, Buenos Aires or Rome as they are in London. It is more accurate to say that they are like skiers or rock climbers who expose themselves to risks in the expectation that they will come back safely to a loving home.

The central insight of the object relations school is that people have distinct ways of organising their relations to others, whether by seeking out or avoiding dependence. Michael Balint’s Thrills and Regression (1959), which distinguished between people who are especially attached to objects and people who prefer open spaces, has a special relevance to Brexit. According to Balint, one type of individual ‘lives from object to object, cutting his sojourns in the empty spaces as short as possible. Fear is provoked by leaving the objects, and allayed by rejoining them.’ Psychoanalysis is a profession associated with living by objects. Analysts, Balint thought, offer themselves to patients as objects to cling to. Another type of person lives in a world of wide, open, friendly expanses, which are nonetheless dotted with dangerous and unpredictable objects. The world of the first type is structured by physical proximity and touch; the second is structured by distance and sight. Security is crucial to the first type, while the second seeks out dangerous pursuits, exposed situations and the unfamiliar, strange and foreign. These are ideal types, of course: in reality, the two are always intermixed. The tightrope walker holds a pole in her hands, the lion tamer a whip, the orchestra conductor a baton; and the trapeze artist returns to the arms of an admiring assistant.

Balint’s distinction has an obvious application to Brexit. The Leave camp tended to cling to such objects as the nation, the community, the family and friends but also race: people ‘like us’. The Remain camp sought out the wide open spaces of the global market. At least, that’s how things look at first sight. But in the course of this prolonged, irresponsible experiment in group psychology, a strange inversion occurred. The Leave campaign, originally motivated by security and familiarity, turned into the de facto proponent of risk – as tariffs, trade deals, waiting lines, passports, ancestral obligations and the like were thrown open to renegotiation. Meanwhile the Remain campaign, originally motivated by the exciting horizons of the continent, was drawn back to the comfort of the status quo ante. Each group found its unconscious in the other.

As the distinction between the two object-relational psychologies breaks down, it is possible to see what lies behind them. The Leave campaign was mistrusting and critical; the Remainers were superior and condescending. But both reflected a common anxiety about their object world, manifested in the Leavers by too much clinging, and in the Remainers by too much insistence on autonomy. Real autonomy cannot be achieved by the individual alone. But it can’t be achieved by clinging, either. ‘The real aim,’ Balint wrote, ‘is to be held by the object and not to cling desperately to it … The profoundly tragic situation is that the more efficiently one clings, the less is one held by the object.’

It has been said that Brexit will produce a new politics based on the opposition between open and closed rather than left and right. This would be a mistake, just as defeating Trump by electing someone with Hillary Clinton’s politics would be a mistake. Rather, what this brief foray into mass psychology suggests is the relevance of a 21st-century version of socialism in forging an outcome responsive to the deeper needs of both camps: a socialism that holds its citizens, while recognising the value of risk and open spaces.