Obvious, but it never occurred to me until an chance conversation with my oldest daughter that 'Cafe' is French for Coffee. M-W says before that it came from the Turkish 'kahve'. I had heard of 'cafes' growing up and always inferred that they were smallish, which agrees with m-w.

Cafeteria, OTOH, well, I'll copy m-w here:
"Etymology: American Spanish cafetería coffeehouse, from cafetera coffee maker, from French cafetière, from café"

So I grew up calling the school lunch room a cafeteria. But also there were places like "The Blue Boar" that my grandparents loved to go to that were called cafeterias where they had buffet-style. However, those buffets were different than the modern ones in that you paid for each trip - and the food was already portioned out on plates for you. You would take a tray up and get several different plates and then you would pay for each individual item on the plate. Buffet I guess means table or board or something like that. It doesn't mean "all you can eat" (at least that's not the etymology). It means "things on a table, ready to eat."

When we moved to AK, there was I recall, on Post, (Ft. Wainwright) a "groceteria" which was often shortened to "the grosh" or "the gross." It was indistinguishable from what we would call today, "a convience store." I've never been to another place that referred to "groceteria." Grocery comes (m-w again) from Anglo-French 'groser' or wholesaler. I recall the first day in our new housing, being sent to the 'gross' with $5 to buy 1 loaf bread and 1 half gallon milk - and coming back with just a little change. My parents had trouble believing I didn't buy something else with it. (This was 35 years ago. It does not seem so incredible now.)

There was an army hospital not too far from there that had a kind of cafeteria in its basement. It was a lunchroom with only vending machines. Hot and cold sandwiches, maybe soups, chips, drinks, etc. I can't remember if there was a special name for it. I think this might have been a throwback to an earlier era.

Regarding "diner," I note that m-w does not include a definition that means "a restaurant." I'm not sure the difference between a diner and a cafe, except I always saw a diner as more home-brew American and cafe as more cosmopolitan. I don't know whether I have correctly inferred the distinction.

Restaurant come from French 'restore.' That kinda makes sense.