https://www.techwalla.com/articles/how-to-detect-iphone-spyware
“Because of the tight security Apple puts into its iOS operating system, it’s next to impossible to install spyware on an iPhone unless it’s been jailbroken.”
Jailbreaking is overriding Apple’s official iOS software with an unsanctioned operating system. This can and usually does expose the user to significantly heightened risk of hacking and identity theft — none of which is the fault of Apple. All in all, Apple does indeed have the safest and most privacy-oriented mobile operating system currently available.