They are not. Other file and photo hosting platforms do not encrypt the data, so they are able to scan server-side. The content is encrypted for iCloud, and the encryption keys are not known by the hosting infrastructure.
This means as an example that shared iCloud albums could be used as a distribution mechanism for child pornography, operating silently until one of the members' accounts gets subpoenaed or they confess and share the list.