The things that you can view at www.icloud.com are synced there via the iPhone options in Settings > [username] > iCloud. They included Contacts, Calendars, Reminders, Notes, iCloud Drive files, and iCloud Photo Library (more information about that at iCloud Photo Library - Apple Support ). They sync automatically when changes are made, but only if those options are turned on. If you lose your phone and replace it with another, the data will automatically sync to the new phone when you turn the options described above on.
Another option is iCloud Backup (you can sync data as described above and also use iCloud Backup, but data that is synced is not duplicated in the backup). iCloud Backups can only be used to restore your iPhone or to set up another iOS device and the contents cannot be viewed at www.icloud.com. There is more information at How to back up your iPhone, iPad, and iPod touch - Apple Support