from what I have noticed it uploads all your messages from all your devices, in my case iPhone and iPad, and then downloads the missing messages to the device they are missing from so you start with all your messages on all your devices
you can then delete the ones you don't want and it will update your master in the iCloud so if you add another device ie a Mac it will upload the messages on it to the cloud and then force download them to you iPhone/ipad and also download the master to the Mac
hope that makes sense