Could someone explain how the TX operation here works? I know this is a BCH address, but it's the best example I could find. The same concept holds for BTC, so understanding what's going on is relevant.

https://explorer.bitcoin.com/bch/tx/5d0af59f43f8e8388839518243c743279e7c3dd526385fcc5bbcd907cd61bd2a

What one sees is one transactions with two inputs and two outputs.


How does it happen that there are multiple inputs/outputs in a transaction?
How did 12WsyKG89bxTGWV1iguxPWh6UX2ye1X8hD end up with 208.448 and 18Q43boBRU8Sk57SjSfjgFbjvXhBccBrKq with 18.816 - where in that transactional data does it specify which address gets what from the inputs?
Multiple outputs are usual, just like e-mail.
If one of your friends has sent you 5 BTC, and another friend has sent you 2 BTC, you should combine and spend them if you need to buy something for less than 7 BTC and greater than 5 BTC.


(By the way, do you know what a change is?)


There is no "This output gets its value from this input" All input values are summed, then spent.