If you've enabled Messages in iCloud on iOS, are the messages still on the device and backed up when the device is backed up?
Your messages will be backed up if stored on the device you are backing up. For example, if you are backing up A and the messages are stored on B, it won't back it up.

A backup is recommended as if you loose your messages on all devices they will be lost.


  Messages in iCloud are updated automatically, so you always have the same view everywhere you use iMessage. When you delete a message, photo, or conversation on one device, it’s removed from all of your devices. And since all of your attachments are stored in iCloud, you can save space on your device.


(Source)