Liam Dillon at Voice of San Diego has an illuminating article on when the police can and can’t pull you over when you’re driving:
The cops can pull you over when they believe you’ve done something wrong….
The technical term for this is that police have to have “reasonable suspicion” you’re violating the law. Reasonable suspicion has no precise definition, but it has to be something supported by a collection of facts and not just an officer’s hunch. An officer witnessing you swerving could be reason enough to pull you over for a minor vehicle code violation – or to check if you’re drunk. An officer not liking the color of your car would not count.
The legal system is riddled with questions like what constitutes “reasonable suspicion.” The legal test is framed in abstract terms but must be applied to specific facts and circumstances. In many cases, this leaves drivers and police officers guessing as to when reasonable suspicion exists and when it doesn’t—at least until a court rules on the situation and gives definitive guidance.