The Chinese understood first that technology has made human spying both difficult and anachronistic. The U.S. spent it intelligence dollars on counterterrorism (fighting jihadists around the world). China invested in technology and economic espionage.
This from an insightful essay at Strategy Page, a military affairs web site.
China had the money, the tech and the trained (and loyal) personnel to tame these new technologies and bend them to serve the state rather than enable people to live more freely. Cellphones and the Internet along with the widespread use of security cameras proved capable of creating a surveillance and monitoring system that made it much more difficult to use traditional spies.