Hi
The encryption key was created before you set a PIN code because your phone has encryption by default (even if you set no PIN/password). This key is stored in a secure component of the phone.
When you set the PIN, the encryption/decryption key has been encrypted thanks to the PIN code. So to decrypt the phone, you need to enter your PIN code.
When you replaced the PIN by a password, the encryption key has been decrypted thanks to the PIN code and encrypted again thanks to your password.
That’s why you don’t need to enter in a full encryption process each time you change the PIN/password. The encryption key is always the same, until your format the phone.