My grandpa on my dad's side was a cop during the segregation era (in other words, as racist as they come). His racism (as he's explained it to me, albeit without realizing it) comes from two things: (A) a tradition of racism (as a country and as a community during that time), and (B) his experience as a cop. His work dealt primarily with tracking stolen vehicles, and he's told me about several confrontations with black people that were trying to ship stolen property or resist/flee arrest. That alone doesn't explain racism, of course --- there's probably a third factor, (C) extrapolation, wherein he makes blanket judgments about all black people based on his experience with a few. Since I personally find it hard to believe that he only ever had problems with black people, given that he was a cop for over 20 years.
Racism of every kind has probably always existed in some form or another in most societies throughout human history; however, the meme of American black-on-white "reverse racism" has historically been an issue of reprisal against institutionalized white racism. Since the white establishment was, for a long time, seemingly hell-bent on driving blacks out of "their system," black communities really had no choice but to bond together as a defense mechanism, and so as a result, both blacks and whites were socially pressured into a sort of "tribal" thinking, minimizing their positive interactions with each other (while drawing attention to their negative interactions) and creating images within each community of the other based more on word-of-mouth and memetic thinking rather than real experience, leading to whites thinking that blacks were all racist against whites, and blacks thinking in turn that whites were all racist against blacks. This creates a mutual distrust which leads both sides to jump the gun and accuse the other of being racist quite easily, sometimes at the drop of a hat (as you will hear "white rights activists" sometimes do).
"I'm sorry
For all the things that I never did
For all the places I never was
For all the people I never stopped
But there was nothing I could do..."