Random number generators are computer programs that were created originally to be used in video poker machines. They replace the need for a deck of cards to deal in a manner that returns results in odds that completely mimic the results you’d get if you played with the real thing. Later this computer program began being altered to return results which odds matched those of different particular game’s real-life odds would create. Games such as Craps, Roulette, and Black Jack suddenly had a computer program that could be played with the same expectations and odds as those we have always been willing to gamble money.
Random number generator programs work by having all the possible results of that particular game fed into them and then it rotates through that list thousands of times a second and then throws out a random result which is what you see on your computer screen or at the land casino’s computer-powered games.
For instance, if a game has three possible different results and the jackpot paid out 10 payback, a little on the shy side of most casinos but it makes my illustration much easier), the first being a no winner, the second being a free spin which is set to happen thirty percent of the time, and the third being the jackpot set to pay out ten percent of the time, it would break down into easily figured numbers. One time out of ten it would return a jackpot. three times out of ten it would return a free spin. The remaining six times it would return a loser. Now you put all those possible results, each on its own casino chip, and put them into a hat. Let someone pick a chip and see what it says for the result of your game. That is how a random number generator works.
For the next spin of the slot machine, next hand of blackjack (they are shuffled after each hand at most online casinos), the next roll of the dice, the next hand of video poker … all the chips that were originally in the hat will be returned and once again, with all the possible results once again in the hat, we now choose again for our next game result. So you can see there is never a possibility for a slot machine to be “due”, or for you to have a “rich” or “poor” deck in blackjack because when the next hand or game is begun, every single possible result is once again active in that hat and just as you could pick two jackpot chips in a row (although unlikely since there would be one jackpot chip to literally thousands of non-jackpot chips), you could also pick two losers in a row (and much more likely because the odds state as such). This is how a random number generator is capable of providing completely random, yet accurate odds results in virtual games.
Copied with permission from: http://plrplr.com/3445/how-a-random-number-generator-works/