It could've been easily prevented by actually arresting someone that committed abject murder, but the city and the police chose to instead defend a man who has killed multiple people in the past and got away with it scott-free. So when people feel like justice no longer exists, there should be no surprise that they get angry.
It doesn't help that the police also employ agent provocateurs whom help incite riots and looting so that they can use more violent tactics with glee.
What else do you think might get this kind of attention? Fact is, incidents like this have been happening for a long, long time, yet nothing changes.
I think it's ludicrous to call a spontaneous out-pouring of despair and anger, after being wronged so badly for so long, an act of "terrorism".