I was actually pretty fit for a 49 year old, but at the same time, very overweight, peaking at just under 130kg. I would walk an average of 15000 steps / day. I also lifted weights. I did not consider that I had a bad diet, but I just ate the wrong stuff at the wrong time.
To keep it simple, sugar is the problem. You can either consume it as sugar or your body will make it from carbs. Once it's in your bloodstream, your body will produce insulin which send a signal to store that sugar as fat. Depending on what you eat and how you eat, your body may never get a chance to stop making insulin and use the calories its storing. Fat does not spike insulin which is why keto and Atkins work and intermittent fasting gives your body a chance to deplete the glucose and make ketones which signal your body to release fat. At my lowest i got down to about 85kg and now hover between 85-92kg (although I just got back from 2 weeks in Barcelona and am terrified of getting on the scale). I now look fit but I would say that I'm not as strong as I was at 130kg, as in I cannot lift as much after this diet as I could before.
I still try to run every day and lift 2-3 times / week but at my age (now 50), what I eat is more important than how I exercise. My super power is that I can eat the same dish every day and not get bored which made it easy to figure out a plan and stick to it.