You cannot outrun a bad diet. Running on a treadmill will not cancel out regular cheesecake or donuts. Still, exercise brings so many benefits that the general recommendation makes sense.
A study in Nature found that two groups taking up to 15 mg tirzepatide, one doing resistance training three times a week and the other just normal activities, lost the same total weight and the same amount of fat. The training group kept more lean tissue. This adds to evidence that telling people weight loss requires diet plus exercise lacks support. Exercise is still valuable for feeling good, keeping strength, managing glucose, and appearance, but it is not a major driver of weight loss. I wish we would stop pairing the two recommendations, especially for people who dislike exercise and might quit if they think they must work out to succeed. Earlier data showed 150 minutes of moderate exercise per week produced only about 1.5 kg loss over a full year, while the right diet can drop that much in a week. Resistance training can help limit lean-mass loss.