The story of Brexit is a complex one, but one thread may be familiar to some developed countries today, including Singapore: too many immigrants, too quickly.
As the European Union (EU) expanded in 2004 from 15 member states to include 10 more countries - mostly poorer ones from Eastern Europe - then Prime Minister Tony Blair opened Britain's doors to job seekers from these countries.
Free to move to Britain to work, many from the new EU countries did, attracted by the prospect of better jobs or higher pay than back home.
As a result, net migration of EU nationals to Britain climbed rapidly over the last decade.
From 2000 to 2003, an average of 9,000 EU nationals migrated to Britain each year, after subtracting those who left Britain that year. But by 2012, this had climbed to 82,000 - and to 178,000 in 2014, said the Oxford University's Migration Observatory.
In particular, the number of EU nationals moving to Britain for work rose from 65,000 in 2004 to 184,000 last year, according to the Office of National Statistics' latest quarterly report on migration.
Total net migration to Britain last year stood at 333,000 people, the second-highest in the country's history since 1975.
Latest available figures show that there were 2.94 million nationals of other EU countries living in Britain in mid-2014, out of the 64 million-strong population then.
Some parts of the country's working class felt the competition and the squeeze. And whether it was grounded in facts or sentiment, the Leave's campaign to "take back control of our borders" resonated with many of them.
Much of the fury of the Leave campaigners focused around accusations that EU migrants were taking British jobs and depressing wages.
And in the aftermath of the referendum vote, Leave voters in the Midlands and the industrial north told reporters how difficult it was to find jobs with decent hours for decent pay.
Outgoing Prime Minister David Cameron, addressing other European leaders at his last EU summit in Brussels last Tuesday, said immigration fears had led to British voters choosing, by 52 per cent to 48 per cent, to leave the EU.
Perhaps Britain had not fully considered the evolving ramifications of EU membership and the allowing of sudden mass movement of populations to an island nation.
But its political leadership also failed to manage the faultlines that opened up as a result.
Worse, some found it expedient to sprinkle racism and bigotry into their arguments to Leave, preying on the fears of voters that Turkey could join the EU bloc, for instance.
Economically insecure voters found their voice in not the two parties in the political centre, but in those on the fringe - namely, far-right parties such as the UK Independence Party (Ukip) and Britain First.
THE SINGAPORE TAKEAWAY
Observing this "growing appeal of nationalist politics, demagogues, and in some cases outright racism" in the referendum debate, Deputy Prime Minister Tharman Shanmugaratnam commented last week: "As politics gets fragmented, the political extremes will gain appeal. We do not know where this will lead to, but it cannot mean anything good."
For Britain, the sad outcome was alarming racist rhetoric and worse, a rise in racial abuse and hate crimes in the aftermath of the Brexit vote.
In the past week, British papers have reported a surge in immigrant abuse, such as offensive leaflets aimed at the Polish community telling them to go home.
Singapore is not alien to these emotions, as the Workers' Party assistant secretary-general Pritam Singh observed in a statement issued the day after the vote.
"In the years from 2004-2010, home started to feel so different because of the pace of change, an emotion that came to the fore again after the release of the Government's Population White Paper in 2013," he said.
Immigration and jobs were hot-button issues in Singapore's general election in 2011, and again at last September's polls, albeit less so.
The public anger seen then was partly a response to the surge in foreign workers, due to a generous foreign worker policy in the boom years of 2004 to 2007.
The total labour force swelled by 600,000 workers, from 2.34 million in 2004 to 2.94 million in 2008, and more than 400,000 of the increase came from foreign workers.
The numbers have slowed considerably since then due to a deliberate policy to moderate foreign worker inflows.
As Brexit has shown, the challenge for political leaders is to drown out the racist rhetoric from the fringes, while offering solutions to the underlying socio-economic problems fuelling such rhetoric.
They also have to take care to not dismiss real concerns and make people resentful by labelling them as racists because of their legitimate fears.
At the same time, leaders should have the moral courage to call out any racist speech by politicians who cloak unacceptable opinions in the excuse of "speaking up for the people".
That is why it is encouraging that both DPM Tharman and Mr Singh condemned demagogy, and stressed the importance of a strong consensus in society.
What would be bad is if what happened in Britain were to happen here - as DPM Tharman put it, "a weakening of trust and consensus in society, and of the centre in politics".
Instead, he said: "The politics of the centre must stay connected to the challenges that ordinary people face - and address their need for jobs and security, and a balance in immigration that preserves a sense of identity.
"Tackling this without turning inward, and weakening jobs and society further, is the central challenge everywhere."