THE POLICE NEED PROBABLE CAUSE TO STOP YOU.
THAT IN ESSENCE MEANS A REASON TO STOP YOU.
USUALLY IT IS A TRAFFIC VIOLATION OF SOME KIND........SPEEDING, WEAVING, NOT STOPPING FOR RED LIGHT OR SIGN ETC
IT COULD ALSO BE NO LIGHT OVER LICENSE PLATE OR LIGHT MISSING OR NO NEW REG TAGS
The reality of life is that the officer will often search without a reason and then fabricate the probable cause (reason) for the search.
If the officer smells alcohol they will investigate to see if you are under the influence. If they are going to arrest you they traditionally search the vehicle.
If they find a baggie with a strange substance they will try to determine if it is a controlled substance.
If it is a gun on the passenger seat they will then order you out and search for further illegal items.........drugs, guns, alcohol etc.
Every time they can search your car if you get arrested and you were in or next to your car.