Currently, the image would have to be imported into the photos library, and iCloud upload must be enabled.
This conversely means that all illegal content can be freely texted and this system won't even catch the distribution of CP unless those pictures are imported into the photos library and icloud updates enabled.
There's a pretty good chance that it was inevitably going to get expanded to handle pictures arriving at the phone through other means.
We can take that discussion if and when that happens.
Whatsapp has a feature where all images are automatically saved to device as they are received. If automatic iCloud upload is on, then all the conditions are there for a person to innocently click on a spammy Whatsapp message, see a bunch of nonsense grayscale images, and continue on with their day--not realizing they are now being monitored for CSAM.