The algorithm attempts to keep wins and losses in a similar range. If there are more wins at any point, then the next losses are repeated, and vice versa. If you have 500 wins and 1 loss, then it is repeated 500 times.