I think they check out the neighborhood and size you up, and if you look like you're got $$ then they charge as much as they want to. Of course you never hire them again. I know a guy who majored in Physics, who makes $90 a hour working at a major aerospace company. I keep telling him he could be making $100 - $200 an hour as a plumber. I've been replacing sewer pipes in my driveway. I got 2 quotes of $12,000 and $6,500 for the job. It's going to wind up taking me about 30 hours and costing my about $500. So I've been saving $200 an hour!
Learning to do your own plumbing and buying your own tools is one of the best investments of your time and money.