This is not a secret, it's documented behavior. https://support.apple.com/en-us/HT202303 And it's not theoretical, because Apple does decrypt iMessage communications in response to law enforcement requests: https://www.reuters.com/article/us-apple-fbi-icloud-exclusiv...
Edit:
> Messages in iCloud also uses end-to-end encryption. If you have iCloud Backup turned on, your backup includes a copy of the key protecting your Messages. This ensures you can recover your Messages if you lose access to iCloud Keychain and your trusted devices. When you turn off iCloud Backup, a new key is generated on your device to protect future messages and isn't stored by Apple.
So Messages in iCloud is end-to-end encrypted, but if you enable iCloud Backup (a different product/feature), then your backup will include the key used to encrypt it.
Though, my limited understanding of iMessage is that if you were to sniff the network traffic you could detect this.