iCloud is the name for Apple’s cloud based service suite. Other than mail and your iCloud backup files, iCloud is exclusively a synchronization service (as opposed to an independent archival cloud storage system like DropBox where files can be kept independent of what’s on your devices).
iCloud Drive is a service that uses your iCloud storage space to store files to by synchronized across all your iOS and MacOS devices. iCloud Photos is a service to sync all your photos to all your devices via iCloud.
All of these services (iCloud email, iCloud Drive, iCloud photos, messages in iCloud, your iCloud backup) are stored in your free or subscription block of storage assigned to your AppleID in Apple’s iCloud system. So if using the free 5GB storage, all of these services are using space that counts towards your total allowed iCloud storage.
Your iCloud storage is also fully encrypted and is “end-to-end” encrypted, meaning anything being sent to iCloud from any of your devices, or anything received from iCloud to any of your devices, is also transmitted over an encrypted internet connection.
The main thing is to remember iCloud is a sync service, not independent storage. Changes to your photos or files in iCloud Drive made on any connected device will be sync’d via iCloud to all, so iCloud itself only reflects what’s also on one or more of your connected devices.