iMessage data is getting scanned with a broader set of heuristics than iCloud data, while it’s supposed to have air tight privacy.
The only phones where iMessage photo scanning happens are those for children under a certain age (maybe 13?) whose parents who have opted into child protection where the phone scans for nude photos and notifies the parents.
People are conflating these two _different_ but _related_ features and their goals and limits.