How does the BTC protocol guarantee that a "main" blockchain emerges? I'm reading up on the bitcoin/blockchain technology.
Usually, the part about proof of work and how to create a block is well explained.
However, what is never explained is how/why the communication of blocks over the network allows for a 'blockchain' to converge.
Let me explain:
what if two miners create a new block at the same time, and broadcast it at the same time ? Roughly 50% of the nodes would have each one a new (different) block, and build on it. Now, imagine this happens again etc. Then, there is not a single blockchain that is worked on, as now miners all work on several forks. The bitcoin proposal addresses this by saying that the longest chain must be used but:

at a given time there could be two forked chains with the same size, and growing roughly at the same pace
knowing which chain is the longest requires to &quot;backtrack&quot; possibly to the beginning, which means that no transaction on any chain can be &quot;validated&quot; as we are not sure to be on the correct chain

Are these issues addressed by the bitcoin protocol? Basically, it seems that there is no proof that adding blocks in a distributed fashion over the network converges cleanly into a single chain.
Bitcoin nodes consider the chain with the most accumulated proof-of-work the best chain. Whenever one chain tip pulls ahead by adding another block, all nodes will reorganize to that chaintip as soon as they learn about it.
Another reason for the network to quickly converge on one best chain follows from how Bitcoin miners get paid. When miners construct their block templates, each includes a unique coinbase transaction which pays the block reward to themselves. This means that finding a valid block results in the block author paying themselves the block reward via the coinbase transaction they included. However, the outputs of coinbase transactions are subject to a maturation period of 100 confirmations. This means that only blocks that spawn at least 99 successors can be spent. This essentially means that a block reward only gets paid out when a block becomes part of the best chain. As mining operations incur large hardware and power expenses regardless of success, miners bleed money when they work on blocks that do not end up in the best chain. Therefore, even when occasionally two miners find blocks at the same time and produce two competing chaintips, even the &quot;losing&quot; miner usually reorganizes quickly to the best chaintip and works on extending that as soon as one pulls ahead, because the stale block that has fallen behind is highly disadvantaged in its bid to become part of the best chain.
While the individual mining efforts are not centrally coordinated, it is uncommon for two competing blocks to be found at the same height: it only happens about once per month. Bitcoin mining is a Poisson process which aims to produce about one block every ten minutes. The cadence is regulated by difficulty adjustments that occur every 2016 blocks, which reset the difficulty target such that the next 2016 blocks are expected to take 14 days under the assumption that the network continues to produce the same amount of hashrate as observed for the previous epoch.