In most professional sports, the structure of the environment is kept neutral so that scoring imbalances may be attributed to differences in team skill. It thus remains unknown what impact structural heterogeneities can have on scoring dynamics and producing competitive advantages. Applying a generative model of scoring dynamics to roughly 10 million team competitions drawn from an online game, we quantify the relationship between a competition's structure and its scoring dynamics. Despite wide structural variations, we find the same three-phase pattern in the tempo of events observed in many sports. Tempo and balance are highly predictable from a competition's structural features alone and teams exploit environmental heterogeneities for sustained competitive advantage. The most balanced competitions are associated with specific environmental heterogeneities, not from equally skilled teams. These results shed new light on the principles of balanced competition, and illustrate the potential of online game data for investigating social dynamics and competition.