I've noticed that some of the SOL required to deploy a program is refunded after the deploy. What's going on to cause this? Is it that the program is uploaded to multiple accounts and then one of them is cleared and its rent exempt balance returned to the deployer? If it is something like that, how come it's like that?
An easy way to see this is to go to https://beta.solpg.io, build and then attempt to deploy the default program, and you get a message like "Initial deployment costs 4.65 SOL but you have 2.00 SOL. 1.55 SOL will be refunded at the end."