iCloud is essentially a synchronisation service. If iCloud Photos is enabled on both your iPad and iPhone, the two devices will synchronise via iCloud; your full Photo Library will also be accessible from other computers using a web-browser.
Devices can be individually configured to use the iCloud Photos - or not - from settings:
Settings > [Your Name / AppleID] > iCloud > [Apps Using iCloud] Photos > Sync This iPad | iPhone
When iCloud Photos is disabled, photos will not be synchronised with iCloud and other devices, but will instead only be saved locally on the device's Photo Library. In this configuration, your locally stored Photos will be included in the device's iCloud backup. By contrast, when using iCloud Photos, locally stored Photos are excluded from the device's iCloud backup, but are synchronised with the iCloud Photo Library.
As such, you might choose to enable iCloud Photos for just your iPhone - but not for your iPad - but in this configuration your iPad's Photo Library will not be synchronised with iCloud Photos.
Consider that iCloud is principally a file synchronisation service. As such, iCloud Photos will keep a copy of Photos stored on your iPad and other Apple devices - and will keep Photos synchronised between them.
It is important to note that, by design, iCloud Photos is not an independent archive. When using iCloud Photos, deleting photos from participating devices will synchronise the deletion with iCloud and other devices that are synchronised via iCloud.
This iCloud User Guide may help you to gain a better understanding of iCloud services:
Share photos and videos with an iCloud Link on iCloud.com - Apple Support
iCloud User Guide - Apple Support