If iCloud Photos is enabled, deleting a photo from your iPhone also deletes it from iCloud and your other devices signed in to the same Apple Account with iCloud Photos turned on.
iCloud Photos is a synchronization service rather than a separate archive of everything you remove from the Photos app. Changes made to the library, including edits and deletions, are synchronized between connected devices.
Deleted photos and videos are normally moved to the Recently Deleted album rather than disappearing immediately. They remain there temporarily before being permanently removed, giving you an opportunity to recover something deleted by mistake.
This is different from using Optimize iPhone Storage. That setting can keep smaller device-sized versions on the iPhone while full-resolution originals remain in iCloud, but the photos are still part of the same synchronized library.
If your goal is to free up local storage without losing photos, manually deleting them is therefore the wrong approach when iCloud Photos is active. Using Optimize iPhone Storage allows iOS to manage local copies while keeping the library available.
Before making large changes to a photo library, it is worth checking Settings > your name > iCloud > Photos so you know whether the device is currently syncing with iCloud.