I think I have a basic grasp of this problem and what led up to it. For the record, I do think that there is a systemic problem with the role of police in America but a shooting rampage against cops is obviously not the answer, ever. That fucked up shit really just makes the whole problem worse and now 4 fathers and husbands have been stolen from their families. It makes me sick to my stomach.
When I was a boy, every patrol car in my area bore the slogan "To Protect and Serve". I argue that the main function of police is still to "Protect and Serve". Look at any "calls for service" log of any department in the US. The majority of calls will be welfare checks (checking on someone), traffic accidents, or taking statements for things like identity fraud or stolen property.
Here's the problem: In 1971 President Richard Nixon effectively declared war on the people of the United States. His army was uniformed policemen. From the days of alcohol prohibition until that day, policing consisted of "peacekeeping", which consists of serving the community in such a way that peace is preserved. In fact, many communities still call their policemen "peace officers".
The role of police, especially in large cities, has changed dramatically. Performance is tied to how many drug busts and criminal arrests a department makes. The bigger the drug busts are and the larger the number of drug users the department picks up, the more funding they get from the State and Feds. Every department wants more funding! You can have more staff to spread out the work, more equipment to make the job safer, a nicer motor pool, new patrol cars, a nicer office, etc. Cops had to shift focus from "keeping the peace and use the law when you have to" to "enforce the law and keep the peace when you can" just to keep their performance metrics up. Now they're called LEOs, or Law Enforcement Officers.
Then the cartel started ambushing officers with bigger rifles. There was a huge military surplus from the war in Iraq/Afghanistan, so cops were given access to military gear to help fight that problem. It wasn't just border cops that were granted access to this gear. SWAT teams and riot squads all around the country (particularly in large cities) got lots of gear, but so did the regular cops. The SW in SWAT stands for "Special Weapons". There was a clear separation between SWAT gear and regular police gear, but that quickly disappeared.
The cartel was losing battle of bullets so they quickly stepped up their efforts to hide drugs and skirt 4th amendment rights to avoid searches. They came up with all kinds of fronts and clever ways of moving drugs. The cops aren't stupid, they knew exactly where the drugs were but they couldn't get to it by normal means. Departments fought back by using SWAT no-knock raids to bust known drug fronts. More busts = more funding. Get all of the high-tech spy shit to find drugs that are hidden in the most unthinkable locations. Hey, look, these new tools even find drugs in the backpacks of teenagers! Nobody would ever object to "Get drugs out of schools!" Get all of the drugs you can, secure all of the funding you can. They aren't fighting teenage potheads, they're fighting drugs. Right?
SWAT no-knocks are now the default response now because of the extreme danger these cartel fucks pose. If you send 2 patrolmen into a location and they come out in bags, you'll always regret not sending in your SWAT. It's always safer to assume the worst, so you also see small time dealers busted by SWAT because when a resource is available, you use it.
This affects everyone, but every statistic I've seen from sources I trust clearly show that this disproportionately affects black people in large cities. When your dad was busted for dealing, your cousin got shot by SWAT, your uncle was arrested for minor possession, and you hear about these SWAT busts in your neighborhood every other day, the cops become less like peace officers and more like an occupying military force. From some cops perspective, you are an insurgent. It's a war after all, right? Your moms house was raided yesterday. YOUR MOM'S HOUSE. They shot her dog! They trashed the place, didn't find shit, then simply said "Sorry, wrong house". If you want to find out exactly how dangerous a man is, back him into a corner like that.
This problem is bigger than you or me or this latest tragedy in Dallas. The only way I can see to solve the problem is to end marijuana prohibition, sever the link between busts and funding, demilitarizing patrol police, and dramatically reducing the frequency of SWAT raids, especially no-knock raids. This is not a comprehensive list, obviously, it's just what comes to mind at 1:46AM. This problem will require decades of thought, effort, and reform to resolve.