IMO it comes down to three things:
1) Branding - Starbucks is a massive company and can spend a lot on making sure their logo and associated products and store experience "feel" good to an absurd degree - from their coffee to the mugs and paraphernalia you can buy to quite possibly the smell of the place and the gum under the table. Gotta target your marketing to the right people, too.
2) Consistency - sure, every decently sized city is going to have coffee that tastes better, but every small shop you walk into may either not be as good as the one back home, or similar quality but, "just not the same." Big companies like Starbucks place a massive premium on consistency even if the product is to s slightly lower average - if it is more consistent, that's more preferable than less consistent.
3) Most people don't drink a coffee product where you can tell the difference. Starbucks - as far as chain coffee goes in Canada - makes a decent cup of coffee, better than McDonald's or Tim's at least. But I'll be honest if somebody handed me a latte, let alone a flavoured one, from each place with a blindfold I'd be unable to tell them apart. That's just the tip of the iceberg, too, my gf regularly drinks their products and normally at this juncture gets a chai latte or some sort of fruity iced tea product. Kinda hard to argue coffee quality at that point. Milk and sugar will cover up the taste of coffee to the point where it's arguably a different beverage in extremes, but it's a different thing when you're not drinking a thing with coffee at all.
I was never particularly big on Starbucks - they're more expensive than the competition and have less and less convenient locations. If I'm traveling and need a cup, you can bet there's something cheaper, closer. But I've basically sworn off the stuff since hearing some of what's been said by their higher ups about some events stateside. They can afford to lose my dollar, but I'm still making that vote.