I am guessing that racial profiling is in our dna as a survival response thousands of years old.  As humans evolved in small family groups,  less than 100 people in most cases,  probably less that 50 most commonly,  it was incumbent upon them to recognize danger in order to survive.  Skin color,  head shapes,  body shapes,  eyes,  hair,  noses,  all would be signs of humans who would present a danger to the group.  Hard to lose DNA based survival mechanisms.  

Law enforcement responds to similar calls,  for common reasons,  to a small variety of incidents and people.  Over time they become adept at instinctively know who they are in contact with about what.  If you see the same demographic,  day in and day out,  they, like the subject of their inquiry,  become commonplace and anomalies fewer and fewer.  The becomes identified as "profiling" and "prejudice."