It is explicitly not legally required in the US [1]. Providers are required to report "apparent CSAM" that they find on their own, but they are not compelled to search their servers or private devices for its presence.
And this is the case for a very good reason: if it was mandated by US law, then prosecutions would be subject to much stronger 4th amendment review under the "state action doctrine" (i.e., the companies are searching your files without probable cause as compelled representatives of the government.) The current arrangement evades this review under the very thin fig-leaf that US providers are doing the searching on their own.
[1] https://crsreports.congress.gov/product/pdf/LSB/LSB10713
Which would be unfortunate. At that point, you won't be able maintain digital privacy from the govt w/o de-facto becoming a criminal.
CSAM is, I think, simply the initial justification for these systems, since it's widely reviled. But the system itself is not CSAM-specific, and the temptation to expand its scope will likely be irresistible.
If your goal was to become an authoritarian tyrant, you would be very happy to have this in place. :-)
That means the alternative would be to send the photos to Apple and Apple scans the photo. Either way you send the photo to Apple and meta data gets generated about CSAM. It’s just a matter of where the data gets generated.
I’m also uneasy about it happening on the phone. But honestly, by it being processed on the phone, that means it can be encrypted before it gets to Apple’s servers.
I’m basically working under the assumption that scanning for CSAM is legally required.