Over the weekend, protests in Milwaukee over a police shooting briefly erupted into riots — as hundreds of people burned down businesses and police cars and attacked pedestrians, reporters, and cops.

But as the details of the shooting came out, we found out that Sylville Smith, the 23-year-old who was shot, had a long arrest record and was possibly armed. That led many people online to wonder why Milwaukee residents would burn down parts of their city over someone who’s, frankly, not an ideal martyr.

One explanation is that the riots were not a response to a single police shooting, but rather the result of festering issues in Milwaukee. As City Alderman Khalif Rainey said after the riots on Saturday night, the area of the protests had become a “powder keg” in the summer. And historians who study social unrest say riots are usually rooted in far deeper issues than may be visible at first glance.

In the case of Milwaukee, the city has been notoriously bad for its black residents. Last year, NPR published an article saying as much, frankly asking, “Why Is Milwaukee So Bad For Black People?” And previous analyses put Milwaukee as the most racially segregated metropolitan area in the country.

The claim is not unfounded. Just look at this map of Milwaukee’s population, broken up by race:

This map shows the deep racial segregation in the Milwaukee area. There’s almost no overlap: Black residents are focused in the north urban core, Hispanic residents in the south, and white residents remain along the outskirts of the area.

As Alvin Chang explained for Vox, this kind of segregation is a result of decades of housing policies that perpetuated segregation, redlining, and other discriminatory practices by public officials and private developers, banks, and more. And it means black people are frequently stranded in neighborhoods that are ridden with poverty, crime, and poor schools.

These factors then limit job and educational opportunities, inhibiting black residents from rising ahead. Study after study has repeatedly found that where you live can have an enormous effect on your life — from income to life expectancy. Segregation, then, dooms many black people to die younger and struggle with poverty while they’re alive.

It’s not just Milwaukee, either. While the city is particularly bad, other places that saw unrest following police violence have enormous problems with residential segregation. Baltimore — the center of riots in 2015 following Freddie Gray’s death — was actually a national leader in neighborhood segregation, creating a legislative model that many other local governments followed, and still impacts city housing today.

These are the kinds of racial inequalities that Alderman Rainey referenced when he said that Milwaukee had become a “powder keg” for the kind of violence we saw over the weekend. It by no means justifies the riots, but knowing why it happened can help prevent more such events in the future.

It was the same kind of observation in 1968 that inspired these words by Martin Luther King: “It is not enough for me to stand before you tonight and condemn riots. It would be morally irresponsible for me to do that without, at the same time, condemning the contingent, intolerable conditions that exist in our society. These conditions are the things that cause individuals to feel that they have no other alternative than to engage in violent rebellions to get attention. And I must say tonight that a riot is the language of the unheard.”

Watch: Why recording the police is so important