Why does the block explorer show an entire amount being spent when I only pay a small amount of BTC?
When making a payment with a Bitcoin wallet, the wallet selects previously received, unspent outputs, also known as UTXOs. Once an output is used as a transaction input, its entire value is included in the calculation. The wallet then distributes that value among the recipient, a change address, and the miner fee.
Suppose a wallet selects an output worth 100,000 satoshis and needs to pay a merchant 30,000 satoshis, with a transaction fee of 500 satoshis. The transaction can have two outputs: 30,000 satoshis to the merchant and 69,500 satoshis to the wallet’s own change address. The block explorer will show that the original 100,000-satoshi output has been spent, but the wallet’s funds have only decreased by 30,500 satoshis as a result of the transaction.
A block explorer can list the inputs and outputs, but identifying which output is change requires cross-checking wallet records. Guessing based on the amounts alone can be misleading—the merchant's payment output may well be larger than the change. For bookkeeping, first verify the order's receiving address and amount, then calculate the fee by subtracting the total outputs from the total inputs. This avoids treating the input amount as the amount actually paid.
The amounts above are examples. Refer to the transaction record for the actual fee. For technical discussion only.
Original source: https://developer.bitcoin.org/devguide/transactions.html#change