I think the difference is that while historically grandma or restaurant chefs were biased towards repeatable, appetizing products, they weren't using focus groups and industrial/scientific methods to get there. I.e. you can't send your grandma to General Mills and have her create Spaghetti-Os.
There seems to be medical consensus that "ultraprocessed" food, as squishy as that term is, is obesogenic. Part of that may be influenced by the marketing and marketing science behind the food as well, but there seem to be human and animal studies that support that our food has changed.