Seems iCloud is mainly a service for syncing the same data across various devices.
Eg: Delete the data from one device, and it deletes on iCloud as well as from any other devices in sync.
Photos stored on iCloud are synced from the iPhone.
It is possible to keep the high-resolution images in iCloud, and the low-resolution images on the iPhone to save storage space on the iPhone. More info: Upload and download photos using iCloud.com - Apple Support
Set up and use iCloud Photos - Apple Support
Eg: says:
Make sure that you have enough storage
The photos and videos that you keep in iCloud Photos use your iCloud storage and your device storage. And as long as you have enough space in iCloud and on your device, you can store as many photos and videos as you
like. Learn more about iCloud storage and device storage
More info: iCloud Support. iCloud - Official Apple Support
________________________________________________________________________________________________
An iPhone has it's own storage amount, chosen when the iPhone was purchased.
An iPhone generally needs around 8 Gb free in which to operate smoothly, and do all the tasks you ask it to do.
To check iPhone Storage: Go to Settings > General > iPhone Storage.
What to do, if you need more storage space on your iPhone itself:
See: If you need more space for an update on your iPhone, iPad or iPod touch - Apple Support
All the best :-)