Apple deliberately makes this non-obvious, but it is disclosed here: https://support.apple.com/en-us/102651
> Messages in iCloud is end-to-end encrypted when iCloud Backup is disabled. When iCloud Backup is enabled, your backup includes a copy of the Messages in iCloud encryption key to help you recover your data. If you turn off iCloud Backup, a new key is generated on your device to protect future Messages in iCloud. This key is end-to-end encrypted between your devices and isnʼt stored by Apple
And is the backup end-to-end encrypted? No, not by default, as disclosed on the same page. It is encrypted "In transit & on server" with keys stored by Apple, which means Apple can decrypt it. And they do, as mentioned earlier, for purposes other than "to help you recover your data". The non-default Advanced Data Protection feature is required to get end-to-end encryption of the backup.
Note that Google's equivalent Android backup feature has been end-to-end encrypted by default for many, many years. Plus, alternative backup solutions are allowed to exist on Android.