When Messages in iCloud is enabled, iMessage, Apple Messages for Business, text (SMS), and MMS messages are removed from the user’s existing iCloud Backup and are instead stored in an end-to-end encrypted CloudKit container for Messages. The user’s iCloud Backup retains a key to that container. If the user later disables iCloud Backup, that container’s key is rolled, the new key is stored only in iCloud Keychain (inaccessible to Apple and any third parties), and new data written to the container can’t be decrypted with the old container key.
So technically there's a security loophole. If a user has Messages in iCloud enabled, then the user's iCloud backup has special access to an otherwise fully encrypted location for Messages