a) "Starbucks" serves in this situation as a generic term for an espresso drink of your choice. Like Kleenex or Xerox or what-have-you. When someone says "people will spend $4 on a coffee at Starbucks without thinking about it" they don't mean at Starbucks specifically, they just mean "some coffee shop that isn't 7-11 or Dunkin Donuts or McDonalds".
b) Even within the category of espresso-serving, $3ish coffee shops, the argument still applies. In a strange town (), in the absence of other reliable information, I will probably go to Starbucks because I know that I'll get a somewhat over-roasted, but drinkable, latte. If I walk into a random independent coffee shop, there's some chance I'll get an excellent cup of coffee. But, experience has also taught me that it's more likely that I'll get something that's no better, or frequently worse, than Starbucks. Similarly, if I'm out of saline or need some allergy medicine while traveling, I'm likely to grab it at Walmart, because all their stores are laid out the same and I can find what I need blindfolded. There is value in predictability in many situations.
() caveat that this applies to travel in the US, and generally for work. In various European countries, I'd bet on the random local shop. And if I'm traveling on vacation, there's value in experiencing something new and local. But, if I just want my morning coffee on the way in to the office, easy and predicable wins.