a couple of factors that can play into food prices as well as other goods are-
volume purchasing
individual store's price point depending on how they market themself.
a store like
Walmart buys large volume so it tends to buy at a lower per unit price so they can offer lower prices BUT Walmart also embraces and promotes that they are a lower price point seller to attract consumers in. another large grocery chain (like Safeway/Albertsons) may get comparable volume discounts but while they have ads with 'specials' they tend to not promote themselves as the least expensive option. Where it gets interesting (at least to me

) is a company like Kroger's b/c they own a variety of different store chains (I believe 19 at this point) so they have the buying power to negotiate low per unit prices but they choose to promote some of their stores as 'nicer' and higher end while down the street is another in their pocket that's considered 'bargain basement'-and the prices for identical items are grossly different.
I see this allot with pantry staples so I was curious and just did a quick search of my local stores for an identical item/size (none of these prices are sales)-
hunts tomato sauce 29 oz-
walmart-$2.17
local employee owned small chain (marketed as nice but 'affordable')-$2.99
Kroger owned (marketed as above average experience)-$2.99
safeway (tries to market as nicer store in our area)-$3.49
local but private owned (markets itself as 'nicest' in region)-$3.49.
that's a pretty significant price difference but I don't think anyone that chooses to shop at the local/private would bat an eye at paying almost 38% more for that item b/c that chain presents itself in a certain manner and I know folks that shop there b/c they wouldn't think of shopping anywhere else (at Safeway you just kick yourself for not having gotten it when they had it on sale/the majority of Safeway shoppers I know strictly shop the sales/which in reality are still often higher prices than they could get at Walmart or our local employee owned chain).