So it's clear that the PSBT contains the necessary instructions for the master private key (in offline Electrum) where to derive the key (witch the index number is).
The cryptography is impressive!
Fun fact: To complement Hosemary's answer, if you need Electrum to scan the balance of a change address outside the default gap_limit, you can use this command to ask Electrum to increase the gap_limit for change by the number you specify, for example, 30.
wallet.gap_limit_for_change = 30
Fun fact 2: In addition to Electrum and Bluewallet (which can restore Electrum seeds and passphrases), there is another way to restore access to the private keys of a native Electrum wallet. See this post:
https://bitcointalk.org/index.php?topic=5265935.0For some reason, Electrum no longer allows me to take a screenshot of its interface within the wallet; it would show the result of increasing the gap_limit for change addresses.
I'm on version 4.6.0