If you're referring to weight loss, it's mostly irrelevant what you eat. It's how much you eat. Not sure why you were surprised.
Health-wise is more complicated. I think some people who're overweight have, e.g., high cholesterol partly because excess body fat causes blood cholesterol to rise. As soon as they start eating less junk (less calories really) than they did before, they lose weight, lose body fat and lower their cholesterol. Same thing with blood sugar levels and blood pressure.
But there are other people who are not overweight and their health problems are not caused by excess body fat. Those people are usually old but not always. They're the ones who'll only see health improvements if they start eating better foods. Losing weight won't help them so cutting down on junk foods without replacing it with better foods is not a solution for them.
By implication then, even the first group will probably see better results if they ate healthy food. I.e. even better results health-wise. So the fact that someone's cholesterol dropped by eating less McDonald's doesn't men that it wouldn't drop lower still if he/she started eating fatty fish and whole grain (or w/e) instead of big macs.
What they will definitely not see is lower body fat. As I said, mostly to do with volume of food that you eat, not what kind of food (this is why sugar and junk food taxes are stupid)
Also, I've used "healthy food" as if it is self-evident what it actually is. I'd consider certain foods like processed carbs and processed meats to be junk food and fruits, vegetables, legumes, certain vegetable oils, wholegrains, low fat dairy, poultry and fish to be healthy foods for their positive effects on things like cholesterol, blood sugar, blood pressure, triglycerides, etc.