The phrase “to turn the tables” is a chess term dating from 1634 that describes a sudden recovery by a losing player.
The switch in position of each side’s pieces makes it look as though the losing player had physically turned the table on his opponent to take over the winning side of the board.
Incidentally, it’s impossible to successively double the number of coins on each square of a chessboard.
By the time you’ve finished you would need 18 quintillion coins, more than all that have ever been minted.
When someone losing begins to win, we say he’s “turned the tables”.