It's one thing to be racist, it's another to recognize a high crime area and population that happens to be black. 52% of the murders in the US according to the Department of Justice are committed by black people. Push those statistics a little further and you see they are committed by a small minority of black people: young gang members in inner city ghettos. They are less than one percent of the population yet responsible for half of the murders, statistically. Look at the statistics of the percentage of other violent crimes committed by that demographic and you are left with a scientifically undeniable conclusion. They are statistically over 100 times as violent as the average US citizen.
If you look at overall crime statistics, cops don't have a lot to be afraid of. Put those same cops in a heated environment in an inner city ghetto and the likelihood that they are facing deadly force, vs. for instance a routine traffic stop, skyrockets.
It's like the difference between being in the military on a base in the US vs deployed to Afghanistan.