" If a place has really good food, it can be in an obscure location, charge a lot, and have really bad service, and it will still be popular. If it has bad food, boy, it better do something really special to get anybody in there." The "special" can be "location". Food on the NJ Turnpike (or similar) is an example of a captive market where quality of food is not the key ingredient but landing the contract and being me…
Just to be clear, this rule doesn't work for McDonalds - as it's an established brand. Their food is awful, but the place tends to be clean and tidy - with a toilet. Interestingly, where I live, Burger Kings tend to be filthy and poorly maintained, with slightly better tasting food. They are also popular - so cleanliness doesn't seem to be a major contributor.
But McDonalds isn't competing on the dimension of "quality" as other restaurants might define that term. McDonalds is competing on scale and consistency. A Big Mac [1] in Jakarta tastes identical to a Big Mac in Cleveland. A pack of fries in Moscow tastes identical to a pack of fries in Istanbul. If you walk into a McDonalds in any part of the world, barring a few local specialties on the menu, you know exactly what you're going to get, and exactly when you're going to get it. That's pretty damned remarkable.
McDonalds runs a marketing and logistics company, not a restaurant chain.
[1] Insert Pulp Fiction reference here.