The queried balance is different from the actual balance

The balance and rewards for this address are 517.264752 Algos and 37.70621 Algos
Why did the last tx save 512.904048 Algos and 33.345506 Algos


The balance on includes all the pending rewards that have been accrued since the last transaction
The difference between the sender balance indicated in the above transaction (512.904048 Algos) and the current balance (517.264752 Algos at the date of your post) corresponds to these pending rewards.

The rewards amount on (37.70621 Algos at the date of your post) is the total amount of rewards (including pending rewards) that the account has earned over time (from its creation).

For technical details on how rewards work, see
The API no longer returns’ pending rewards’
How do I get it