Imagine four slot machines. Each time you play, you choose one with a weighted probability, and the weight is how many times it won in the past.
So on your first play, you randomly select a machine. Now imagine that machine wins. It now has a probability of 1 vs the other three with 0. So you play it again. Now it loses. It now has a .5 probability, and the other ones have 0. Your next play will be a 50% chance of the same machine, and 50% chance of one of the others. You keep going this way and eventually you will pick the one that wins the most often most of the time, but sometimes you'll pick one of the others, just to make sure your probabilities are still correct.
How is this useful to a programmer? It's great for A/B tests. For example you come up with four different home pages, and then define success as clicking on the signup link. At first you randomly show a homepage to each visitor, but as you progress, you'll get one homepage that converts better than the others. You'll show that one most often, but sometimes show the other ones to give them a chance to "catch up", just in case your initial traffic happened to be biased.