Now both whatsapp and Facebook have this, but surely they have the encryption keys too, or how else would they seamlessly fetch your messages and decrypt them when you get a new phone?
I don't know about either anything factual, but I believe it was said that WhatsApp crux in the e2e is the iCloud backup. I believe that's where your old message get restored from.
I believe you can also disable that iCloud backup and thus the ability to retrieve those messages with a new phone.
End-to-End means encrypted in transport and not saved (in any form that is decryptable) on their servers. To that, I believe whatsapp fulfills their end of the bargain.
WhatsApp for Android doesn't seamlessly fetch and decrypt messages on new installations; you have to set up Google Drive backups from your old phone, and then set up restore from those backups on your new phone.
Now both whatsapp and Facebook have this, but surely they have the encryption keys too, or how else would they seamlessly fetch your messages and decrypt them when you get a new phone?
If they do, then what's the point?