It's very true that for weight loss, diet is the single most important variable, but that doesn't mean exercise doesn't matter. The kind of exercise you do matters a lot, too, particularly once you start caring about lean mass vs fat, rather than just the gross scale weight. Cardio has this image as "the way you lose weight", but I think that strength training is vastly superior, overall.
Strength training doesn't have to be ultra time-intensive or strenuous, but it has huge benefits for both health and weight loss; muscle is metabolically-active tissue, taking 6-10 kcal/day/lb to maintain, vs 2-4 kcal/day/lb for fat. This has two implications: first, in a caloric deficit, the body will preferentially catabolize unused muscle tissue over fat, since it's more expensive to maintain, and second, maintaining a greater percentage of your weight as muscle rather than fat increases your daily "just keeping the lights on" caloric expenditure. A caloric deficit with a high-protein diet and even moderate weight training will result in a significantly higher level of retained muscle mass, resulting in more net calories/day burned, even on the days you don't train. Think of it as the difference between active and passive income - the more "passive caloric burn" you can rack up, the easier it is to make progress towards those goals.