Pegasus is spyware used to target high-profile people. It is easily distributed because of a bug in iMessage where someone can send you a blank text, but they have already gained high privileges on your phone. This cannot happen on Android, as there is no central messenger.
When you launch an app on your phone, it creates a VM, from which you can use the app. The app is in a sandboxed environment where it cannot escape. At least that is what Apple says.
Using certain methods, the malware can gain high privileges and spy on you.
It does that by exploiting a vulnerability in Imessage which allows it to run any code that it wants to.
There is really not much to talk about, but thats another reason of why you should not use your Iphone.