By Richard Webber and Trevor Phillips

How much do changes in migration at the local level alter the politics of immigration? The conventional wisdom is that they do not change a great deal. It's said that deprivation, education, cultural values and news intake all play a much bigger role.

To take one truism, for example, many of the places most supportive of Brexit were among the least diverse. To the extent that the 2016 EU referendum was a proxy for attitudes to immigration, those areas most hostile to freedom of movement were not the ones experiencing it first-hand – certainly compared to their Remain-voting counterparts in super-diverse cities.

But what if this analysis only looks at part of the picture? Academic studies have found that it is not the level of immigration that alters attitudes, but rather the pace of change. They point out that already-diverse places are often positive about migration, whereas places becoming more diverse tend to be negative.

Our new analysis, on the other hand, suggests a counterintuitive story. Over the last decade, as constituencies have become more diverse, they have switched to Tory blue, at least when this change is a new phenomenon. Meanwhile, those seats that are diverse but are getting demographically whiter have turned a deeper hue of Labour red.

Our study, Red Walls falling and the parallels with migration and gentrification, looks at this question over the course of the 2010s – a decade which saw four general elections. To do this we use Origins, a name recognition tool presenting a live picture of the ethno-cultural makeup of each community.

The report charts changes in the size of the non-white British (non-WB) population, in each seat across England and Wales. It then looks for parallels between these and the cumulative Labour-Tory swings during the same period.

This was a decade in which, on the surface of it, the Conservatives had the upper hand. But there were big shifts beneath the surface and the swing to the Tories was by no means universal. Lewisham West and Penge, for example, swung 22 points to Labour over nine years while Mansfield swung 23 points to the Tories.

The table below shows seats which had the biggest swings one way or the other, along with the 2011 non-WB levels and the subsequent non-WB increases.

The findings reveal that seats swinging Tory by 15% points or more were less than half as diverse as the national average at the start of the period. But the pace of change was actually faster than average in subsequent years.

Places where Labour experienced swings above 15% had the opposite dynamic. They were two and a half times as diverse as the average seat, but were changing more slowly than average.

The scatter chart below shows the 2011 level of the non-WB population in each seat on the horizontal axis and the 2011-19 change in that population on the vertical axis. The bigger the dot, the bigger the swing.

We can see that almost every seat which was diverse in the first place swung to Labour during the 2010s. But we can also see that the places that have swung most dramatically to Labour are those where subsequent change is stable or where the non-WB population is falling.

The Cities of London and Westminster, for instance – traditionally a Tory stronghold – saw a nine point swing to Labour. This happened alongside a fall of 4.5 points in the size of the non-WB population (from 52.4% to 47.9%) – at a point when Britain as a whole got more diverse. For other examples see Streatham, Bristol West or Kensington – all of them diverse to start with, all becoming less so.

In seats where the non-WB population is rising from a low base, meanwhile, the opposite was the case. Of the 49 constituencies where the non-WB population has increased by over a third since 2011, 44 have swung to the Tories.

Barnsley is a good example here. Historically it is solidly Labour. But it has seen a six per cent cumulative swing to the Conservatives since 2019, during a period when the non-WB population rose from six per cent to 8.5%. Even more pronounced case studies would be Thurrock, Walsall North or Corby.

What does all this tell us? Migration at the local level is a small factor in voting patterns, after all. But we cannot ignore that the 2010s were a period during which the Tories' rhetoric became more eurosceptic and anti-migration, and where Labour's became more cosmopolitan and socially liberal.

Neither can we ignore that other factors, such as the expense of inner-city housing, led to migration increasingly happening in parts of the UK where it had not occurred before. This arguably fed into deeper values divides. Places with less experience of change – and those that were potentially less relaxed about difference as a result – saw among the biggest non-WB increases.

Ultimately, most of the inner-city areas that have swung Labour since 2010 are now characterised by gentrification and a more positive attitude to migration. Non-WB increase happened many years before, and in recent times the resulting diversity acted as a draw rather than a deterrent for liberal graduates – many of them from top-tier big-city universities which remain disproportionately white.

In the areas where the Tories have advanced most dramatically, by contrast, there is little cultural history of diversity, with changes being new and conspicuous. These seats are at a different stage of the journey in terms of attitudes to race and multiculturalism.

Perhaps what these changes really show is that we need a less static political understanding of which areas are diverse and which are not, and a more comprehensive and detailed theory-of-change about migration and how you manage it.

Richard Webber is joint managing director of Webber Phillips Ltd, a visiting professor at the University of Newcastle and the originator of the Mosaic postcode classification system which the Conservatives and Labour have used for targeting electors during the past 20 years. Trevor Phillips is also joint managing director of Webber Phillips. He is a businessman, a Times columnist and a senior fellow at Policy Exchange. You can follow him on Twitter here.

The opinions in Politics.co.uk's Comment and Analysis section are those of the author and are no reflection of the views of the website or its owners.