I'm pretty sure it's derived from gambling (as mentioned). So it means that one is increasing (or doubling) the risk, for the possibility that it pays out in the future.
Like the more money you bet, the higher the stakes. In other words, you are risking to lose money in order to win money.
I hope that made sense. It was harder to explain that I expected. ㅋㅋ