This service exists so Apple can E2EE your data while still placating DOJ.
It's a cop in your phone.
What they actually do is what is important. And what they actually do is publicly disclosed so you can make your choice appropriately.
Edit: The point here is that even if Apple tries very hard to make this be only about photos about to be uploaded to the cloud, if the percentage of phones that turns off iCloud storage increases as a response to this new "snitch-on-me" feature that will be a very good argument for law enforcement to ask for a list of IMEIs that are not using iCloud, and it will also tempt them to demand that Apple start scanning all files.
It's very simple. You want to upload images to iCloud? Then let your phone scan it and upload it. You don't want your images scanned? Don't upload them to iCloud.
So turn off iCloud photos?