Apple doesn't have access to your iMessages unless you give them permission by consenting to have your keys backed up to iCloud. If you use iTunes backup (or don't back up your phone), the Messages will be encrypted and can only be unlocked if you have a device that still has the keys.
https://support.apple.com/en-us/HT202303
"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."