Tops, a major supermarket chain, has managed to keep two supermarkets open inside Rochester city limits for decades. One is in the northeast, which Little_Nemo talked about, and one in the southwest. The former is now a heavily Latino neighborhood and the latter a black neighborhood, and the stores are geared to those clienteles.
I lived in the northeast until after college, mostly near the intersection of Joseph Ave and Clifford Ave (which is what Empire Blvd. turns into when it hits the city). But the northeast is a big place. Walking to the northeast Tops would have been a trek, especially coming back with the groceries. (And my mother had arthritis in her knees.) Taking a bus would have meant going downtown and getting a transfer. Again, difficult with a load of groceries.
Sustaining chain supermarkets can be done if the companies are willing to adapt their stores to fit the community and be willing to take a smaller profit margin. Wegmans, their much storied and far more locally successful competitor, closed down all of its smaller stores inside Rochester because they weren’t the money machines the huge suburban stores were. (One store remains, albeit at city limits, in the nicest area, and renovated into twice its former size.)
Chains can make these decisions. Nobody remembers today but A&P built itself into a byword by putting up thousands of stores across the country. L.A., IIRC, had 400. Each was 1000 sq. ft. That’s not a typo. They were 20’x50’ storefronts. They sold mostly canned foods, though, with some fresh goods, not exactly the model to break a food desert. Their size enabled them to lower prices and still make money, so much money that states starting passing laws banning chains. It became a huge issue during the Depression.
Anyway, low-price bare-bones chains with smaller stores and fresh foods like Aldi and Price Rite are starting to move into cities (there’s two of each in Rochester). Price Rite is a spin-off from the supermarket chain ShopRite. Small size spin-offs that get the buying power of a big chain but can cut prices with fewer frills may be the way in. Independents without that clout find it difficult to compete. Where the sweet size is that allows walking instead of driving hasn’t been found yet, though.
And of course I’m talking about cities. Rural food deserts obviously require cars and they’re a different case to crack.