Bitcoins are not saved in wallets.
The only important data in a wallet are the secret numbers called the private-keys.
The nearest approximation to the truth is that bitcoin are stored in the public blockchain - of which every bitcoin wallet either maintains its own copy or has access to a copy.
In the case of the wallet named "Bitcoin Core", the private keys are stored in the wallet.dat
file along with a lot of other unimportant stuff. On MS-Windows Bitcoin core stores a local copy of the public blockchain in a set of files named blk00001.dat
to something above blk01234.dat
in %APPDATA%\Bitcoin\blocks
.
What is actually stored in the blockchain data is just transactions. Just a complete historical record of amounts of money for which control has been transferred from one person's private-key to another person's private-key. Some clever mathematics allows this to be done without disclosing private-keys. To work out a balance you have to read the whole blockchain and subtract the sum of spent amounts from the sum of received amounts. The blockchain is what accountants would call a journal. It doesn't keep track of balances directly.
The profits of mining are handled in almost exactly the same way as ordinary transactions. The first transaction in a block is the so-called coinbase transaction which pays the miner the amount of mining reward specified in the rules plus the transaction fees from the other transactions (if any) in the mined block.
So how does this relate to unused addresses in wallets?
It doesn't. These are unrelated concepts. Wallets generate addresses in advance of them being needed. This is just a convenience so far as I know. It is helpful when using the seed-phrase or private-key to re-create a destroyed or lost wallet as it allows the new wallet to find amounts of money received and spent by the previous wallet(s) at a range of addresses.
Addresses are just numbers used in popular types of bitcoin transaction. These numbers don't have any intrinsic meaning - they don't identify people or places or anything else. They are just a number mathematically derived in a deterministic way from a public-key associated with a private key.
So most wallets will have many many unused addresses with no balance associated with them because they have not been used yet in any transactions.