What Is the Purpose of the “Change Output” in a Standard Bitcoin Transaction?
The purpose of the "change output" is to return the difference between the total value of the input UTXOs and the intended payment amount (plus the transaction fee) back to the sender's wallet. Since UTXOs are indivisible, a transaction must spend the entire value of the selected inputs.
The change output is a new UTXO created in the same transaction, sent back to an address controlled by the sender, ensuring no excess funds are inadvertently paid as a fee.