At least two reasons have been advanced for this disparity: racism and differential levels of criminal behavior. Of the two, racism is a sort of "residual" diagnosis, what we turn to when no other fact explains the observed behavior.
As Scott Johnson writes at Power Line, we do not need racism to explain extra police attention.
The dirty little secret of the assault on law enforcement in the name of racial disparities is the underlying behavioral disparities that account for them.The New York Post writes:
To take just one example of the underlying behavioral disparities, this 2011 Department of Justice report (p. 11) notes that blacks committed homicide at a rate 7.64 times that of whites over the period 1980-2008 and that black on white homicides are approximately twice as frequent as white on black homicides.
The FBI claims that gangs commit 80 percent of crimes in the US, and the National Gang Center estimates that 82 percent of gang members are black or Hispanic.Crime attracts police like flowers attract bees, or carrion attracts buzzards. Police experience greater frequency of criminality from black people and Hispanics, and hence pay more attention to them.
The proof, black and Hispanic cops behave the same as white or Asian cops in this regard. See a Daily Caller article in which the Chief of the El Paso Police, who is himself African-American, condemns the Black Lives Matter organization as "a radical hate group."
Expecting police to behave otherwise is irrational. Inevitably, police sometimes pay attention to people of color who are behaving themselves and it is, naturally enough, resented.