I understand that something called a ‘fork’ occurs when two blocks are formed at the same time. As I managed to gather from googling, this means that two separate blockchains are created.
Wikipedia describes "fork" as "what happens when a blockchain diverges into two potential paths forward", it mentions several different types of forks and explains that:
"Accidental fork happens when two or more miners find a block at nearly the same time. The fork is resolved when subsequent block(s) are added and one of the chains becomes longer than the alternative(s). The network abandons the blocks that are not in the longest chain (they are called orphaned blocks)."
Skipping all the different fork types (accidental, intentional, hard, soft,...), what actually happens in case of a "race condition"? Which block is added first? How is the problem resolved? If two chains are created, how are they later combined? Is one block simply abandoned?
