From the blockchain's perspective, there is no such thing as "confirmation blocks". That's mostly a term coined by centralized exchanges and other trading platforms.
When a miner mines a block, he broadcasts it to the network. Due to latency issues, some nodes hear of it sooner, some later. Because not everyone hears of it at the same time, it's quite possible that another node has also managed to mine a block before hearing of another solved block - and then we have two valid blocks. Eventually one of them will become an uncle block and one continue in the canonical chain.
Which block becomes part of the canonical chain depends on the miners: which block do they decide to mine upon. Mostly this is the oldest new block they know about. It may happen that some percentage of the miners keep on mining on block A and other part of the network mines on block B. The parties which are stronger win, because their chain becomes longer, and the losing parties abandon their chain and start mining on the other chain.
Because it's never 100% certain that one specific new block stays in the canonical chain (remains the block on top of which all other blocks are mined on), trading places want to wait certain amount of blocks. The longer they wait, the more certain it is that a certain block will not be replaced anymore.
If the waiting time is too short, the chance for the block to be replaced may be too high. If the waiting time is too long, the user experience suffers. So they choose some amount of blocks to wait, after which they believe it's certain enough that no changes are made.