The gambler's fallacy, also known as the Monte Carlo fallacy, is the belief that in a series of chance events, runs of a particular outcome will be balanced by a tendency of the opposite outcome. For example, if I flip a coin 7 times and each time it comes up heads, one falling prey to the gambler's fallacy may predict a higher chance of the coin coming up tails on the next flip. But in reality the likelihood of a (fair) coin coming up either heads or tails is always 50%. Each flip is independent. All prior flips have no influence on the next.
One of the reasons people may fall prey to the gambler's fallacy is that they misapply the law of large numbers. The law of large numbers is a mathematical theorem that states that if you repeat a random experiment a large number of times, your outcomes should on average be equal to the theoretical average. The key point here is that the experiment is done many, many, many times and as such this theorem is no basis of support for the gambler's fallacy. For instance, if I flip a coin 10 times (small sample size) I may or may not come close to the theoretical average 50% heads. If I flip a coin 100 times, it is more likely that I would end up with something close to the 50% heads but may still have a large degree of variance. If I flip a coin 1000 times, I am going to end up with something close to 50% heads. If I flip it 10,000 times, I should be very close to the theoretical average.
The most famous example of this fallacy happened on August 18, 1913 in a casino in Monte Carlo. The roulette table had landed on black 10 times in a row. People were convinced that the likelihood of it landing on black again was very low, so they increased their bets. But again the ball landed on black. It did so on the next spin, and the next, and again next. Each time the gamblers were more convinced of the near impossibility that the next spin could land on black and so they continued to increase their bets. But the ball continued to land on black. It did so for a total of 26 consecutive spins. It was indeed a very profitable night for the casino.