What shines out brightest from Peter Gatrell’s panoramic history of migration in Europe since 1945 is that this is a story of comings and goings, not just arrival. Ideas about home and belonging are constantly shaped by the forces of state power, capital and everyday human interaction. You can feel it most strongly in the accounts of individual experience that Gatrell has woven into his narrative. There are the “starved, frightened, suspicious, stupefied” ethnic Germans expelled from eastern Europe at the end of the war, who arrive in a country most have never set foot in before; or the returning British colonial settlers who decide in the 1960s that they prefer Portugal’s Algarve to Blighty, because the cheap booze, servants and warm weather remind them of the Raj. Western European officials are surprised when the “guest workers” from Turkey, north Africa and elsewhere they invited in to help rebuild their economies in the 1950s and 60s don’t want to return when recession sets in – but don’t entirely want to give up their connections to the old countries either.

It is also a story of sharp contrasts, of both violent uprootings and unremarkable journeys that continue today. Affluent “Eurostars” – bankers and IT specialists who live in one EU country and work in another – jostle with “illegal” immigrants such as Shahram Khosravi, an anthropologist from Iran who turned the lens on his own clandestine journey to Sweden, or Ukrainian migrant workers who complain that the fall of communism has merely replaced the iron curtain with the “velvet drape” of border control. In teasing out these differences, Gatrell – a professor of history at the University of Manchester who has written widely on migration and refugee rights – wants to add what he sees as the context missing from today’s fractious political debates on immigration, in particular the response to Europe’s “migrant crisis” of 2015-16.

Gatrell is concerned that the situation now is starting to resemble the “violent peacetime” of the years immediately after 1945, when millions of people were uprooted, many of whom languished for years in “displaced persons” camps or were picked up and discarded by states according to their economic utility. “As the archipelago of camps and detention centres spread across the continent and farther afield,” he writes of the recent crackdown on asylum seekers, “the founding fathers of closer European integration – many of them having had direct experience of Nazi persecution before and after the second world war – would surely have turned in their graves at what their successors had done in the name of Europe.”

Migrants in an inflatable dinghy are rescued by French coastguards in the Channel, August 2019. Photograph: AFP/Getty Images

If this crackdown is justified by appeals to “a time of imagined security and stability”, Gatrell argues, then it requires a profound forgetting of Europe’s own recent past. Piecing together material from political and economic history, ethnography and cultural studies, The Unsettling of Europe makes the case that the continent has been neither an impenetrable fortress nor an open door. Instead, states have generally sought to manage migration to their economic advantage, with consideration of the human impact often coming as an afterthought.

In part, this has been a story of progress, not least in the wealth and prosperity it has helped Europe achieve. Migration is at the heart of the development and maintenance of welfare states, the right of people to move freely was central to the liberalisation of regimes in the former eastern bloc, and the current international system of refugee protection has its roots in the efforts to deal with mass displacement in postwar Europe. But migration also has its dark side: the short-termist and sometimes callous policies of governments who treat migrant workers as a means to an end, the hostility and racism that people moving around Europe have often encountered, and the periodic imposition of border controls that push people to hire smugglers, or risk their lives, to get where they feel they need to.

Gatrell divides his chronology into five periods. The first, which runs from 1945 until the mid-50s, covers the years when many of Europe’s borders as we know them today were settled. This was no simple process of redrawing the map: in central and eastern Europe in particular, it involved the mass displacement of millions of people to create relatively ethnically homogeneous states in that part of the continent. Even at this early stage, governments on both sides of the emerging cold war looked to migration as a way to address their shattered economies. While the USSR and its satellites made heavy use of forced labour and resettlement, western European states cherry-picked the skilled and able-bodied workers from among the thousands who couldn’t or wouldn’t return home. The distinctions made between desirable and undesirable migrants were reflected in the way they were talked about, then as now: in 1949 the Daily Mirror was complaining that other countries had “taken the cream and left us most of the scum” who “add to our discomfort and swell the crime wave”.

The second part deals with the boom years from the late 50s to the early 70s, when millions of people moved from country to city, from south to north, or from other parts of the world entirely to fill a demand for labour. This was an era of decolonisation for many of the western European empires, although the subjects and citizens “returning” met with vastly different treatment. French pieds noirs forced out of Algeria were greeted with fanfares; the harkis, Algerians who sided with them during the war of independence, arrived in overcrowded boats by night, or took clandestine routes into France. Unauthorised migration went across the Mediterranean in the other direction too: some Italian settlers who were made to leave Libya after 1945 went back there without permission in the postwar years, until they were definitively expelled by Colonel Gaddafi in 1970.

As Europe’s borders came down internally, the EU started to harden its external frontiers

The latter parts of the book, which run from the mid-70s to today, cover what to readers might be a more familiar though no less vital story. Many of the people from Turkey, Yugoslavia, Greece or Vietnam who built the roads and the cars and dug the metros of wealthier parts of the continent put down roots, as did black and Asian workers from Britain’s former empire. This forged new connections, but it was shadowed by the rise of an anti-immigration discourse that focused on fears of cultural difference. A predicted tidal wave of migration from east to west after the collapse of communism never materialised, but large numbers of people were displaced during the break-up of Yugoslavia, challenging governments to uphold their commitments to refugee protection. And as Europe’s borders came down internally, the EU started to harden its external frontiers.

Gatrell’s eye for detail and sensitivity make this a compelling account that challenges the “us” and “them” framing into which much discussion of migration is forced. Its great strength is that it treats the emotional and cultural aspects of the subject with as much respect as the historical facts and figures. Among the many vivid stories to be found here, one that sticks in my mind is that of the Swiss journalist who, when asked about Italian workers in his country in the mid-60s, wryly commented: “We asked for hands, but we got people instead.”

• The Unsettling of Europe is published by Allen Lane (£30). To order a copy go to guardianbookshop.com or call 0330 333 6846. Free UK p&p over £15, online orders only. Phone orders min p&p of £1.99.