Expanded Protections for Children
www.apple.com
"Before an image is stored in iCloud Photos, an on-device matching process is performed for that image against the known CSAM hashes.
This matching process is powered by a cryptographic technology called private set intersection, which determines if there is a match without revealing the result. The device creates a cryptographic safety voucher that encodes the match result along with additional encrypted data about the image. This voucher is uploaded to iCloud Photos along with the image."
en.wikipedia.org
It's not your only protection. There's another hashing process done on the server that's separate from the on-device system, except it's only done to a minimum of 30 images rather than your whole library.
It's a hybrid system. First part is on device, second is on server and only when it passes through both of those does it get to human review.