I don't have the reference, but apparently there used to be US laws requiring producer / manufacturing / distributing companies to sell to all grocery stores at the same price. Because of this regional and local grocery stores could buy inventory at the same price that Walmart does, and because of that there were a lot more local and regional grocery stores.
At some point (under Regan?) the US got rid of these laws, Walmart in particular realized that it could compete on scale (and aggressively negotiating Walmart-specific deals), and that's a huge part of why we don't have as many smaller grocery stores anymore.
I don't have the article handy but if anyone else knows details about this I'd love to hear more.
(Bonus points for a LMGTFY answer :) )