Obviously there are much, much larger parts of the problem, but a good chunk of it comes from cops having no connection to the neighborhoods they're being tasked to keep safe. You put a white cop in his own neighborhood, they'll behave mostly as you'd expect of law enforcement. You put a white cop, who has little connection to African Americans outside of arresting them or other crime related activities, in an African American neighborhood that he just sees crime in and all of a sudden they become nervous, jumpy and sees everyone as threats. The neighborhood doesn't see the cops as any good either, for obvious reasons , and that escalates the tension.
It isn't going to fix the problem completely, but simple community outreach programs would at least be a damn step. Any step is needed at this point.