As stated in the Bitcoin whitepaper, nodes always treat the longest blockchain as the truth and continue to work on it. All miners should work on the longest blockchain because it helps to maintain the uniqueness of the blockchain ledger. If the Bitcoin sent to you is not recorded on the longest blockchain, you could possibly lose it.
Since all miners throughout the world are mining simultaneously, it’s likely that two of them get the right answer at the same time. Upon this situation, the blockchain will fork, and other miners may choose to keep mining on one of the forks to extend the blockchain. That’s why 6 block confirmations are usually required to ensure that the miners won’t return to the other forked chain after the Bitcoin transaction is processed.