Reduced NEAT (non-exercise activity thermogenesis/walking/fidgeting) is a bigger factor by an order of magnitude.
100% of weight gain is due to net caloric surplus. The main contribution by far is eating more calories.
https://jissn.biomedcentral.com/articles/10.1186/1550-2783-1...
In other words, loosing weight starts with portion control as the largest factor for most people.
It's unpopular because the fitness crowd is so religious and ignorantly-stuck in anti-intellectualism, but the best strategy to lose weight is to gain as much muscle mass as possible with the less effort to accomplish in order to raise NEAT. It doesn't take a lot of time or effort (mostly dedication and planning) to stimulate muscle development effectively, and becoming a gym rat is essentially wasted time, money, and effort. It's nice to have cardio fitness too, but I would do the minimum to avoid too much IIB to IIA conversion like the anorexic-looking treadmill-only gym users do. If you want no glutes, avoid squats and lifts, and run a lot.
https://www.webmd.com/fitness-exercise/features/does-running...
Though I agree with you, it's more the overall activity that is way down than just gym/exercising.
Was this just gym displacement or was it everyone with exercise availability?