What happens in the bitcoin network when two miners solve a block at the same time?
When 2 miners solve a block at the same time the block in the longest chain wins and the other block is discarded and considered a stale or orphaned block. All the transactions are returned to the mempool.
What is a stale block?
A stale block is the block that was in the blockchain but then dropped because another block that was produced at the same time was part of a longer chain.
How do stale blocks occur?
Stale blocks occur when a block was valid for a while because 2 were produced with the same version of the truth but then dropped because the blockchain continued on another block.
Why is it important to wait for more than one block to be confirmed when sending or receiving a transaction?
It is important to wait for 6 confirmations to be sure that the block your transactions are in is not dropped from the chain.