There is a very well known probability theory, often used as a Roulette system known as the Martingale. In brief the theory, which is centred on the even money bets in Roulette (Red/Black, Odd/Even, High/Low) suggests that doubling one’s stake after a loss will eventually result in recovering all previous losses. In practice it does not work because in many cases, before the recovery is made, the punter either runs out of money or he reaches the house’s table limit and cannot bet any higher. A more sophisticated system known as the Labouchere employs a stakes plan to limit losses, but is still not a genuine system proven to work.
A book entitled “Thirteen Against the Bank” by Norman Leigh tells the exploits of a group of punters who took on the casinos successfully employing a reverse Labouchere staking system (too involved to detail here) covering all the even money bets on the roulette table. This was a successful strategy and depended on the fact that “long runs” occur within 50:50 probabilities and the system exploited those long runs whenever they occur.
These long runs are similar to the tossing of a coin you describe. Every toss is 50:50, but from time to time long runs of heads or tails will occur. The cumulative odds of those runs occurring (and the winnings if they are exploited) are high, but they do occur.
In theory the longer a series of tests (coin tosses) is, the closer to 50:50 will be the results. But long runs do occur, even though every toss is 50:50.