Actually, for iMessages, that's not entirely accurate. The cloud does forward SMS messages to your devices, and iCloud backups do include SMS libraries along with most other files in your phone, but other than that, it doesn't store or really sync anything in a substantive way. Case in point, when you set up a new device without restoring from an iCloud backup, data such as Notes, Reminders, Calendars, etc are downloaded from your iCloud account, but nothing is stored there for Messages (separate from an entire iCloud backup file) and you need to start fresh. Deletions and thread histories don't sync across devices at all. So while conversations do pick up where you left off most of the time, that relies on the receiving device being able to accept incoming messages. If something prevents that, thread histories do get out of sync and there's no real way to fix that. I recently had a situation where I had to set up my MacBook Pro from scratch and a messed up backup prevented me from restoring many files. My photos, files, calendars, notes, etc all downloaded from iCloud just fine, but my Messages app was completely empty and I had to start fresh, in spite of many years' worth of message histories being right there on my iPhone and iPad.
A real iCloud syncing solution, like how the Notes app functions, could allow cloud storage of message histories, reliable syncing of histories, changes and deletions, and perhaps even an iCloud.com web app. I've been wanting this for years, but an issue often brought up is how this would play with end-to-end encryption. That I don't know, but what I do know is that the Messages app doesn't act like many of the other Apple stock apps when it comes to syncing across devices, and I find it frustrating. I wish my messages database would just sync to my Mac from my other devices, but unfortunately there doesn't seem to be a way to do that yet.