The definition of "ultra-processed foods" is governed by NOVA and its results are very suspect. Take a look at this boneless, skinless chicken breast [1]. It's considered an Unprocessed or Minimally Processed Food. We know that there's no way chicken breasts just "fall off" chickens like this: animals are killed, skinned, cleaned, butchered, and then packaged to get this product. This firm tofu [2] on the other hand? It's considered an Ultra-Processed Food of course, despite being a staple in East Asian countries that have
much lower incidence of obesity than many Western countries. Among many other problems, there's a huge bias in the NOVA system for food that Western diets consider "primitive".
While there's no real answer yet, most science is beginning to point to overeating as the real culprit. Processed foods simply make food more delicious, making you eat more of it. Munch on some raw broccoli and well you'll get tired of it real fast. Fry the broccoli up in some olive oil and it'll taste a lot better, so you'll eat a lot more of it. Since WWII we've increased the availability of salts (counting MSG here), fats, sweeteners, and spices. Fast food thrives off very cheap manufactured products designed to make caloric dense foods taste delicious.
Compare American portion sizes to portion sizes anywhere else in the world when eating out. They're enormous. While the science isn't definitive, it's beginning to look a lot more like controlling how much you eat is the answer. The problem is in our current world it's trivial to eat delicious food and eat much more than you need to survive.
If you cook, the cool thing is you can use the same tricks fast food uses to make healthy food much more delicious. You can incorporate fiber heavy vegetables, season them with some salt and MSG and make them delicious while filling you up. Eat heavy on proteins which make you stay full for longer (this doesn't mean meat, there's plenty of vegetarian protein dense options like tempeh, tofu, and seitan out there.) But applying these tricks at a population level continues to be a huge, unsolved public health problem.
[1]: https://world.openfoodfacts.org/product/3266980891411/filet-...
[2]: https://world.openfoodfacts.org/product/8410789140118/tofu-f...