if, somehow, there are 2 nodes whose ledgers have conflicting transaction histories, how is it decided on which version all the users must go by?
Each node decides for itself. Each node makes these sorts of decisions independently. No node trusts any other node to make these decisions for it.
Each node independently examines all the data in all the alternative chains it creates as it receives data, including conflicting data. Each node independently calculates the amount of “work” represented by each chain and selects the chain with the highest amount of work as its active chain. This decision is re-examined every time the node receives data that alters the amount of work represented in any of the chains it knows about.
Because all Bitcoin nodes follow the same rules for this, they all independently select the same chain. They naturally achieve consensus without any explicit collaboration, voting or central direction.
Most chains have a common ancestry and only the last block or so vary. This means that keeping track of multiple chains can be done relatively efficiently without duplicating the common portion.
The measure named “Work” is based on an estimate of the average number of hashing attempts that would be needed to find an arrangement of data that produces a block with a hash less than the target applicable at the relevant block height.
Footnote on terminology
Although many people describe the Bitcoin blockchain as a ledger, that is misleading. Accounting ledgers have accounts and balances. The Bitcoin blockchain is a simple transaction journal not a ledger. It contains no accounts and no explicit balances.