When you have a big kitchen and eating out is expensive, you cook at home unless you have money to splash. When only money-splashers go to the restaurant, restaurants shift up-market and offer lots of choice instead of, say, one dish.
And also, when restaurants are expensive and so everyone is cooking at home, everyone starts requiring a home kitchen. When everyone requires/has a home kitchen, it doesn't make sense to shift down-market to cater to those without kitchens.
Go back in time 300+ years, and it was pretty common for urban residents to eat out daily. Not just because it saves housing space, but also because indoor fires were often banned to reduce the chance of the entire apartment block burning down. It was not universal, obviously, but it was pretty common.
$5 a meal x 3 meals a day x 30 days a month is $450 a month. That's a decent amount of money, and it's questionable at best whether you would save that much in rent by removing a kitchen entirely from the amenities available to a tenant.
I guess there's labor in portioning or serving, and a lot of labor on the back end for cleanup? It's an interesting problem, because I know that I can make a ton of food way more easily and cheaply than small individual portions, and when I look at breakdowns of restaurant costs, somehow rent isn't an outlier, labor and materials contribute a lot to the costs. But I feel like having already purchased the necessary equipment (or amortizing it across 100,000 meals or whatever) I could feed 100 people with less than $100 at Costco. But you can't go to a restaurant and get something bad for $5 that fills you anymore, not easily. Where's the money all going?
Of course, luxury food is a fine thing to have. The lack of a basic option is weird, though.
Most of what currently ails the restaurant sector can be traced to real estate costs. Even if your food and labor are free, real estate kills you as you have to put your restaurant where your customers can get to you.
And the problem is being exacerbated by private equity having piled into commercial real estate. I can point to all manner of restaurant sites that closed up because the rent got jacked up and then were left idle for 5+ years. Standard landlords simply can't eat that level of rent loss. Private equity, however, will take an almost infinite loss in cash flow as long as they can kick the can down the road indefinitely and never have to pay actual cash.
Grocery store margins are pretty high on prepared food.