The most important reasons behind the prevalence of xenophobia in South Africa are economic and the tendency to criminalise foreigners.
Existing explanations in terms of economic crises, political transition, relative deprivation, or remnants of apartheid all contain an element of truth but are not in themselves sufficient.
Proclamations from politicians coupled with media reporting on drug syndicates, prostitution and human trafficking, all feed and in turn feed off a popular perception that migrants are bad for South African society and its economy.
It is all too easy for the media and the government to place blame on immigrants for crime, unemployment and housing problems but it is not a long-term solution and, eventually, can only be detrimental for the economy, culture, society and international image of South Africa.
The government faces a pressing need to find a way for citizens and foreigners to live peaceably together and to tackle the problems that xenophobes justify their actions by.
Xenophobia may manifest itself violently through rioting and attacks on foreigners amongst the poorer, black population, but it is an issue for all sectors of South African society and one that is becoming increasingly urgent for the government to address.
Perhaps the most important point to realise is that these misguided feelings of hatred and bitter resentment are based solely on the perception of economic harm and of immigrant involvement in criminal activities, therefore the primary focus for the government must be education and to correct these misperceptions.