Don't know about Android phones, but for iPhones we have a "key ring" on our iCloud where all the passkeys are stored. When we change iPhone, the "key ring" is downloaded onto the new phone with all the passkeys.
I have a spare iPhone (older iPhone 13 pro max) that I am using at home like a mini iPad, the "key ring" is on that phone too and I can log into all passkey related sites. Similarly for all of my iPads and MacBooks.