Messages in iCloud, as the name suggests, stores your iMessages in Apple's cloud servers rather than on each of your individual devices, which has a number of benefits.
When you receive a message on one device, it shows up on all devices logged into the same iCloud account. Likewise, when you delete messages and conversations they are instantly removed from all your devices.
Another advantage of the feature is that your messages, photos, and other message attachments are stored in iCloud, which frees up space on your devices. In addition, all your messages appear when you sign into a new device with the same iCloud account.
To make sure that Messages in iCloud is turned on for you, follow these steps.