Deleting photos from iCloud will remove the corresponding photos from all devices that are signed-in to iCloud.
As for additional space being required for either your iPad or iPhone, you need understand that device storage is determined during manufacture - and is fixed for the entire life of the device. You cannot add more device storage.
By contrast, iCloud storage is shared by all devices that are signed-in to iCloud with the same AppleID. This “cloud” storage is used to synchronise various services between devices - and can be used to keep a backup of each device. Additionally, iCloud can store your Photo Library and other documents.
All AppleID accounts have a free 5GB storage quota. For most users, this is only sufficient for basic service synchronisation services. Photos and device backups will quickly fill the meagre 5GB storage. Where 5GB is insufficient, should you choose to do so, you can subscribe to more iCloud storage space to meet your needs. Paid storage tiers (shared by all your devices) are 50GB, 200GB or 2TB.
Upgrade to iCloud+ - Apple Support
iCloud+ plans and pricing - Apple Support
Subscribing to iCloud+ also provides access to other features at no additional cost - such as iCloud Private Relay, this being a useful privacy feature:
About iCloud Private Relay - Apple Support