The martingale system doubles the stake after every loss so that one win recovers everything. It appears to work in small samples, which is what makes it dangerous: most sequences end in a win, and the rare long losing run takes everything at once.
Two constraints break it in reality. Capital is finite, and exposure grows exponentially - ten consecutive losses require a thousand times the original stake. Markets also trend, so the losses are not independent and the long run is more likely than a coin-flip model suggests.
Recognise the disguised versions: averaging down on a fixed schedule, grid systems without a stop, and any account that shows a smooth equity curve with occasional total collapse. See adding-to-losers and risk-of-ruin.
Related: adding-to-losers, risk-of-ruin, gamblers-fallacy, doubling-down