because there is no central database to gather the information as its decentralized?
This is just mathematics. Bitcoin wallets uses the Hierarchical Deterministic wallet, that is, it generates all it keys and addresses from it main source.
Hierarchical – The keys and addresses can be organized into a tree.
Deterministic – The keys and addresses are always generated in the same way.
When you import the seed phrase to your wallet, the BIP version/standards are backward and forward compatible, the wallet go through the blockchain to find every address with balance in the wallet.
Although, some wallets would require you to pick the kind of address you want to import either the Legacy, Segwit or the likes, because their derivative path are different.
everything is done through the Hierarchical Deterministic order.