Hello!
iCloud work slightly different than google photos as you don't actually "delete" the photos from your device. iCloud does backup and store all your photos in the Cloud. If you choose to optimize storage on your device, the device will start to remove the actual file from the device leaving basically a place holder in the photos app. When you click on the place holder the device will download the full size image. I am not sure if I explained that too clearly 😆 but, you can find details about iCloud photos and storage management below:
Set Up and Use iCloud Photos: https://support.apple.com/en-us/HT204264
Manage Your Photo And Video Storage: https://support.apple.com/en-us/HT205703
Let me know if this helps!