Welcome to iMore!
iCloud backups work in the background, backing up your device as you sleep (though you can trigger a manual backup). If you ever needed to restore or setup a new device, one of the options would be to restore from iCloud. So if you don't have a computer or aren't near one, you can restore over the internet.
You can't selectively restore however, it's all or nothing. So you can't just restore iMessages, but they would be included if you restored your device.
Hope that helps! If you have more questions, please
register and reply back here!