I have a problem understanding the concept of handling two or more blocks that distributed at the same time (in the blockchain network).
As far as I understood, When I get 2 or more blocks at the same time, the miner starts to create a new block on the top of the longest block he received.
But what if user1 got BlockA and BlockB (BlockB is the longest one), and user2 got BlockA, and BlockB is delayed (it takes time to send this block to user2 because of many reasons), so eventually user2 sees only BlockA at the moment, and starts to build a block on a top of this block, while user1 builds the block on top of BlockB.
I don't fully understand how blockchain synchronizes the blocks properly. I need a better explanation.