When you encrypt it, it creates new private keys.
Unless I misunderstood you, are sure this is the case?
I just tried to create a new wallet and then dumped the keys. Then I encrypted it and dumped the keys again. I see the same private keys.
The other parts of Loyce's reply already explained it.
Encryption will not get rid of the old used private keys, those stay in the wallet, it'll just generate new set of keys (
for non-HD) or create a new HDSeed (
for HD).
Bitcoin Core will then issue those new keys / new HDseed when the user request for new addresses.
So, if OP backed-up an old unencrypted wallet.dat but used the wallet after it's encrypted, that backup wont be able to re-create the keys created after encryption.