Each ball has equal chance of being randomly deflected either to the left or to the right of that peg. The ball proceeds downward to the next row to the peg that is immediately in the path of the ball. This process is repeated for each of the 7 rows. The 7 pegs (one per row) that are struck in the process are denoted by the color red.
After a random zigzag course downward, the ball falls into a slot, which is immediately to the left or to the right of the last peg struck. The ball counter for that slot is incremented. Also, the total-balls counter is incremented.
The theoretical random distribution of 128 balls in the 8 slots is as follows:
1, 6, 20, 37, 37, 20, 6, 1, TOTAL = 128
Note that the chance of an individual ball falling into the leftmost slot is only 1 out of 128 (less than 1%), whereas the chance of the ball falling into the fourth slot from the left is 37 out of 128 (approximately 29%).