Here is how it goes. They stop you. While they've got you, it is easier to pile on charges than having to go chasing after someone else. Or they are just bored. Or they had a fight with their gf and now they are pissed off.
So they "smell" drugs. Ok, they ask you if they can search your car. They do it in a very casual kind of way, you know, "mind if I take a quick look around the front seat of your car?". If you know what is coming, you should say "no, I don't consent to a search". Then they tell you they'll bring in the drug dogs, so might as well let them as they'll "go easy on you". You still refuse.
So now you are going to get punished because you are not cooperative. Drug dog can come in anytime from a half-an-hour to an hour later. At this point it the officer is angry and he is pretty sure you have something to hide. He is expecting a nice drug bust. Drug dog comes in 2 hours later. Officer walks him around the car. Come back and says. Dog signaled, drugs. "We are going to have to search your car."
So they search your car. They don't find drugs but maybe they see a suspicious looking package in your trunk, is that a bomb? Could be. Maybe they see some white powder in your backseat.
Better take you into the station, it might be cocaine, they need to test it better. You are at the station, being booked. You are there for the whole weekend + a holiday on Monday.
Finally after 3 days they drop the charges and let you go. And all you wanted was to go and get flour and milk so you can make pancakes on Saturday for breakfast.