Part of the processing is to add something harmful or remove something useful either as the target of the process, or as a byproduct.
I give you a tomato, that's unprocessed. I squash it a bit and maybe add some salt? That's processed. I boil the hell out of it and mix it with 30 other ingredients (like salt, sugar, flavoring, preservatives, other additives, etc.), especially in large quantities? That's heavily processed or above. As you can see, the processing is what made a tomato worse for the health.
Not "necessarily", but "realistically". I think we need to start by clarifying what "processed" means from a practical (legal/commercial) perspective rather than common sense. What you call "processing" as a normal person, like boiling, frying, smoking, canning, fermenting, baking aren't necessarily even considered "processed" in the commercial sense. They're considered "preservation" (e.g. smoked fish) or "cookery" (e.g. bread). So almost every process that humans applied to food until the 19th-20th century was basic cooking and preservation, with a few exceptions of convoluted foods.
The modern interpretation of "processing" only begins at the next level. When the process has a lot more added steps and ingredients which in practice are almost guaranteed to be less healthy. But when we say "ultra-processed" it's guaranteed that it has significant health downsides. Ultra processed food has decreased nutritional content due to the processing, and high levels of unhealthy ingredients or components (like sugar, salt, trans fats, preservatives, and all kinds of other additives). Many ultra processed foods have more sugar, salt, or trans fats than they have the purported main ingredient. I'm just looking at a jar of "pistachio cream" that has 50% more sugar than pistachio.
So for all intents and purposes, in practice, processed food makes it less healthy and ultra-processed is synonymous with very unhealthy.