It doesn’t has to reach 6 confirmations. It’s just that the more confirmations (new blocks mined on top) the more certainty you have that the transactions init are imutatable and on the blockchain forever. Because after each new block (confirmation) you require more proof of work to reorg the blockchain with a different longer chain.
When 2 miners mine a block at the same blockheight, you basically fork the blockchain where each blockchain has a different last block. Then it depends on wich blockchain the next miner mines a new block on. Wich makes 1 version a longer chain than the other. The rules are that the longest chain wins. So that block on the shortest chain will become a stale block, and all transactions that aren’t already included in the winning blockchain will go back to the mempool.