If you turn the tables, you change the situation completely, even reversing it. When you're tagged "it" in a game of tag, you turn the tables on your pursuer and start chasing her instead of running away.
Any time you start winning after losing, you turn the tables on your opponent. You'll turn the tables on your ping pong adversary if, after a weak start, you come from behind to win the game. Fittingly, the phrase turn the tables comes from the game-playing tradition of turning a backgammon board around so that players trade positions.