Technically there is no such thing as a bitcoin. Just unspent transaction outputs. Those get spent as an input of a transaction and then are gone forever. There is no concept of the output of a transaction being the same "bitcoin" as what comes from the input of the transaction. This means if you had 2 inputs and 2 outputs of the same amount there is no way to trace which input became which output. At best you can find which outputs potentially came from an input.
When blocks are verified it just needs to validate that sum of the outputs isn't more than the sum of the inputs. It doesn't care about tracking what went where.
Except I can literally pull up a full node and see a wallets current balance - which is because it traces all the transactions through the blockchain, verifying all of them.
Literally the only way anyone can see their wallet balance is by doing this.
I will say it again. When validating the chain all it cares about is that the sum of the output UTXO for a transaction are <= the sum of the input UTXO. All the input UTXO are no longer valid once spent and can be forgotten.