Currently, I see many gyms being dominated by the same teams. They might get displaced, but they typically hold the gym in terms of average occupation time. Maybe Niantic could offer a substantially increased XP reward, and/or other potential rewards, for capturing a gym which is held by a certain team for the majority of the time. The greater the average time it’s held by a particular enemy faction, the bigger the reward could be. This would require holding data about the occupation time of the three individual teams, so it would add to storage reqs, and processing time, but I think it could increase competition. This would further encourage people to fight for territory outside their traditional ranges. Right now it feels like there is little incentive to travel 5+ miles, just to attack a gym in an area you generally don’t have any other reason to travel to. This means that people will do a couple things that lower competition: New players choose a team that already dominates their area so they can remain in gyms for longer periods of time, and existing players won’t be as likely to explore outside their own usual territory.
As an example, if Team Mystic holds a gym for more than two-thirds of the time in the week, you could earn double/triple/quadruple the xp you currently gain for attacking the gym.