This is of course a massive privacy violation, since the code that scans for CSAM can be switched out to scan for anything else at any time. (It's even easier to do now than when Apple first proposed it, as language models since have gotten good at reading images.)
Apple was already doing image recognition on device for photo searchability when they proposed that solution.
But that did not really carry data out from the device, other than hashes. I think Apply knew this was coming, and tried to do it better.