It's a bit more nuanced than just "you have to obey." Technically you have the right to ask why they're stopping you, and the cop is supposed to have a legal reason (you were driving weird, there was a report about you, you're near a high-risk area, etc). If it's really without reason, you can refuse but yeah, that's at your own risk - a fine is likely. The thing is, contesting it afterward is a pain, so a lot of people just cooperate to avoid hassle, even if technically the stop wasn't legit. If you feel like you were really harassed or stopped in an abusive way, you can always file a complaint or contest the fine later, but in the moment you're not really in a position of power.