Why do some transactions use more gas than others, even when they are transferring the same ERC20 token, for example USDC. Even when the receiver is the same and the transferred amount is the same. This one used 42,381 gas: https://etherscan.io/tx/0x05c86098176a2d7d7d85375c7745503c36b7abc7dbdcbcdd01802859b6fec3a9 This one used 27,381 gas: https://etherscan.io/tx/0x4499361f0ab60aed804f6d4ead7aa2ec0f801dcc3cfa1d945bd82c1081ca8611
The difference of 15,000 gas is caused by a gas refund which occurs when storage is cleared (see Yellow Paper Appendix G):
Rsclear 15000 Refund given (added into refund counter) when the storage value is set to zero from non-zero.