Jail breaking gives you root access so you can remove apps you don't want but doesn't stop any already made malicious code for the apps you leave on the phone. It also doesn't help you with malicious code in the OS itself.
When you install a new OS on a phone, it will replace the main OS but the wifi chip still has its own custom OS that is unaffected. Think of it like a stripped down OS that only handles communication. This is at least how it works on custom Android ROMs.
Will jailbreaking not put the user back as administrator? I haven't looked at jailbreakimg in years, I'm OOTL.
Jail breaking gives you root access so you can remove apps you don't want but doesn't stop any already made malicious code for the apps you leave on the phone. It also doesn't help you with malicious code in the OS itself.
When you install a new OS on a phone, it will replace the main OS but the wifi chip still has its own custom OS that is unaffected. Think of it like a stripped down OS that only handles communication. This is at least how it works on custom Android ROMs.