What happens in the bitcoin network when two miners solve a block at the same time?
The blockchain will split into two ends and begin propagating throughout the network. The block that forms the longest chain in the network will become the new addition, with the other block becoming a stale block. The transactions from the stale block will be returned to the mempool.
What is a stale block?
A stale block is the discarded block from the shorter version of the blockchain. The transactions from the stale block are returned to the mempool to be processed into a new block.
How do stale blocks occur?
When two miners amend a valid block into the blockchain at approximately the same time. These newly amended blocks propagate throughout the network until the longest chain is accepted, and the new block from the shorter chain is discarded. The transactions from this discarded block are returned to the mempool.
Why is it important to wait for more than one block to be confirmed when sending or receiving a transaction?
New blocks have a possibility to become stale blocks. It is standard practice to wait until 6 confirmations.