Midwestern US experiences here:
Poorest neighborhoods = high prices, except for a small set of loss leader items.
Poor neighborhoods, ethnic groceries = very cheap for a small set of items (rice and often, vegetables), high for the rest.
Middle class neighborhoods = cheap, especially if there are no apartments or condos nearby.
Upper class areas = expensive with few exceptions. Meat which is about to go bad is the best exception I’ve seen.
Recently I’ve noticed that prices can get jacked up very high if residents don’t have cars.
I’ve always assumed that shrinkage and security played the biggest role in pricing.
It’s been touched on but I will reiterate the importance of car ownership here. Got a car? Great - in any metro area there’s probably a half dozen grocery stores you can choose from within a twenty minute drive. You have the luxury of shopping around. However, 9% of American households don’t have a single car at all (not counting the additional households where the one car spends most of its time being tied up in taking breadwinners to jobs or kids to school etc.). In most of the country if you are at the mercy of public transit it’s only marginally better than walking. Most people will walk about a mile in twenty minutes. Ask yourself what your grocery choices would be in only the one mile radius around your house?
Let’s use my hometown, Austin, Texas, to illustrate a point.
If you live in a middle-to-upper middle class neighborhood in Austin, you’'ve probably got loads of strip malls and big box stores and chain stores nearby. You can, therefore, go to a supermarket where you can get a gallon of milk for $2.98, a loaf of bread for $2.49, and a dozen eggs for $1.98.
If you live in a poor black/Hispanic neighborhood on the East side of town… well, the supermarkets probably left your neighborhood decades ago (they may come back as your neighborhoods continue to gentrify). You buy your food at small mini-marts, convenience stores and bodegas where you pay a lot more for your food.
Now, what about RICH people? Well, it depends where they choose to live. Rich people in Westlake Hills have supermarkets available. Those markets have higher rents than those in my neighborhood, so they have to charge a little more for food, but not much.
But rich people in, say, Tarrytown, are more picky about the kinds of retailers they allow in their neighborhood. They don’t like strip malls or box stores- too tacky. But those people can certainly drive to supermarkets that aren’t too far away.
But the nouveau riche and the yuppies who live in the big high-rises springing up all over downtown Austin? They definitely do NOT have supermarkets close by. And driving from downtown is a major pain. So, they either shop at smaller nearby specialty food stores, and pay a lot more for thir groceries… or they make periodic trips to faraway supermarkets and buy in bulk.