The Bitcoin White Paper: 9. Combining and Splitting Value...
Although it would be possible to handle coins individually, it would be unwieldy to make a separate transaction for every cent in a transfer. To allow value to be split and combined, transactions contain multiple inputs and outputs. Normally there will be either a single input from a larger previous transaction or multiple inputs combining smaller amounts, and at most two outputs: one for the payment, and one returning the change, if any, back to the sender.
Satoshi lays out how a single transaction can have many wallets sending some bitcoin and many wallets receiving that bitcoin.
"It should be noted that fan-out, where a transaction depends on several transactions, and those transactions depend on many more, is not a problem here. There is never the need to extract a complete standalone copy of a transaction's history."
So transactions are flexible and can include many different wallets of bitcoin on both ends of the transaction. This is helpful to companies like exchanges that deal with tens of thousands of different customers and have a way to reduce the number of transactions needed to settle all their individual bitcoin transactions.
Thanks to the Nakamoto Institute for making the whitepaper available freely via an Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license. More info on that here: https://creativecommons.org/licenses/by-sa/4.0/