The first quote says it happens to “all photos stored […] on a user’s iPhone”. The second quote clarifies that it only happens to photos that are going to be uploaded to iCloud Photos, and that the scan is performed before the upload happens.
I'm not 100% sure if this is about the on-device portion of this. Gmail and OneDrive already use this (and have for the better part of a decade) and I haven't seen any large outcry. Also, Apple has confirmed that turning off icloud photos means this doesn't work (this is separate from iCloud backups).