Sometimes it really is a thin line.
In my country (The Netherlands) police sometimes check all cars passing a temporary checkpoint. They check if you have open fines, paid your taxes etc. When really expensive cars pass those checkpoints they verify that the owner actually has a job to afford cars like these and if the owner doesn't they can impound the car on suspicion of being paid with criminal money.
Statistics have shown that the highest "risk" group of those crime paid cars is with young foreign male drivers.
A few years ago a (black) rap artist was stopped at the side of the road by police and they basically admitted that this was racial profiling.
The artist made some fuss about it on social media, and it appeared in all news broadcasts and talk shows. People were expecting some big commotion about it; but it turns out that the majority of people actually approved of this method.
It wasn't racism at work here, it was statistics and people were fine with it. It is a thin line though, because to the people on the wrong end of the statistics it really can feel like racism. So where should police draw the line?