While looting has taken place at various times and has a number of factors xenophobia seems an ever-present element, and one that seems to increasingly factor into rioting and violence in the country. Xenophobia was indeed thought to the main driving force behind the 2008 riots and this was repeated in the 2015 Johannesburg riots, however the country is also littered with permanent murder hotspots that often see the army deployed to control escalating violence. In some ways xenophobic violence stems from the legacy of apartheid, after apartheid ended in 1994 incidences of xenophobia increased contrary to common expectation, but some in the government have also promoted blaming foreigners for social problems such as unemployment and drug issues.
aljazeera.com/news/2019/7/19/cape-town-army-deployment-not-a-long-term-solution dw.com/en/south-africa-is-more-unequal-than-ever-20-years-after-the-post-apartheid-trc/a-46059235 hrw.org/news/2019/04/15/south-africa-attacks-foreign-nationals aljazeera.com/news/2019/9/8/one-killed-five-wounded-in-new-johannesburg-violence web.archive.org/web/20091124132407/http://www.hsrc.ac.za/Document-2994.phtml