You can back up messages on an iPhone to your iCloud account, or sync messages from your iPhone to your Mac.
Part of the reason you don't often see people with Android phones using other Apple products is that the two ecosystems ...
Messages is designed to sync across all your devices logged into to the same iCloud account. iMessages sync by default; SMS/MMS and RCS messages sync if you’ve enabled access to them from your iPhone.