Actually, Apple probably does have the capability to flash modified firmware to the phone without triggering an encryption key wipe - remember that this isn’t a naive attacker, this is the vendor, who knowns the source code and has the tools to do things like write bits directly into the phone’s flash memory, completely bypassing the application processor until the modifications are in place.
Whether or not it’s correct, Apple is widely perceived to have good security, particularly compared to it’s main competitor Android (because people can’t distinguish between Android the current version and shitty phones that OEMs can’t be bothered updating that run old versions of Android).