If you had that stored in your suitcase, it can be discovered, and a prosecution started.
If you had that stored in your phone, it can be discovered, and a prosecution started.
Phones aren't magical parts of your brain, that can cross borders without being inspected. There's no digital 'diplomatic pouch'. Just because there's lots of sensitive goodies inside doesn't mean it's immune to inspection. Why would it?