Labor costs and legal compliance requirements are higher cost. It's also priciest in San Francisco due to geography, traffic, and distances. Certain things are cheaper; others are more expensive because we foodies demand a lot of high-end products. For DH and I it's expensive because we really love good food, I'm a gourmet cook as is my whole family, and we dine out extensively as a hobby.
You can buy a loaf of Wonder Bread at $4 for a 20-oz loaf at Safeway (probably cheaper at Wal-Mart, but nobody I know shops there if they can avoid it, and they usually can). Or instead, artisanal Starter Bakery's Pain de Mie at $10.49 for 27 oz. loaf. Firebrand Bakery's artisanal sourdough French baguette is $5.99 for a 16 oz size.
Kraft's Cracker Barrel White Vermont Cheddar (which I like very much) is $5 for an 8-oz pkg. But I can also buy Jasper Hill's Cabot Clothbound Cheddar at $9.88 for less than 6 oz., from the great state of Vermont and one of the top cheesemakers in the U.S. But better than both (if you're a Brie-type lover like my spouse) is Cowgirl Creamery's Mt. Tam, at $13.99 for 8 oz. Only the French imported Saint Angel is better, IMHO.
It all comes down to what you enjoy in life. Around here groceries can be cheap or expensive, depending on what you buy and where. You can buy a bland commercially-raised chicken in a plastic bag, or you can choose an organic air-chilled free-range chicken, or even a specialty variety like the Chinese black-skinned chicken or yellow-feathered chicken. A fresh-killed chicken is $4.99/lb. but there's nothing better for Hainanese yellow rice and boiled chicken with salt and pepper dip!
We just dined at a high-end butcher shop that has added a full restaurant to its retail outlet. The food was excellent. Peruvian beef heart skewers, Thai green curry chicken soup (super spicy, whew!), lamb burgers with fries, roasted broccolini and a shared dessert, was $83 before the tip. That is in line with prices at other restaurants around town. Figure by the time you buy the organic meats and veggies, do all the prep, grill/simmer/fry/roast/bake all those dishes, you wouldn't save much money trying to make it yourself at home, LOL.
It's a lifestyle choice. Also, don't forget that a lot of Millennials/singles buy deli or pre-prepared foods at supermarkets, which gets lumped in with regular grocery expenditures. For one or two people it often isn't worth cooking at home even if you enjoy doing it, unless you like eating leftovers for days on end (for me, 3 days is the absolute limit, LOL). The San Francisco Bay Area is such a competitive environment that even our delis, food trucks, and hotel restaurants offer quality food.