Great Question. iCloud is used by Safari as a sync service. Just like apps like Photos, Messages, Mail, Notes, Contacts and others. To see a complete list of apps that uses iCloud as a sync service please Open Settings ➔ Apple ID (Your Name at top) ➔ iCloud. Every App that you see in the list which is set to ON is using iCloud as a sync service. This means that the data for those apps is synced LIVE and across all your devices that are signed on to the same Apple ID. The data for these apps is not in your iCloud backup and is maintained real time on iCloud.
When you cleared history and website data I Safari then you will have immediately done so for that device. Just like when you delete a photo or a message on your iPhone then it gets deleted on iCloud as well along with all other devices that are logged in with the same Apple ID and iCloud is active.
What is happening is that you are clearing history and website data and it is getting deleted from iCloud immediately. When you restore from iCloud backup then those tabs and website data are not coming back because they were never in that backup.
One thing that does backup everything and like the way you had initially expected and that is do create a computer backup periodically. An encrypted computer backup will backup everything. The drawback here is that when you restore from your computer back up then your iPhone becomes as current as the day and time that computer backup was created.
Axel F.