What actually happens when you use "Erase all content and settings", at least on any 'recent' iOS device, is that a cryptographic key in the Secure Enclave, which is used to "wrap" the actual encryption key for the user data filesystem on the device, is wiped — this renders all data in the user data filesystem completely unreadable. (The system volume containing the OS itself is left untouched.) [Source]
A restore from Finder/iTunes actually wipes the device NAND and replaces the system volume with the contents of the IPSW restore image. [Source]
Functionally speaking, from the user's perspective, the end result is the same in both cases — a factory default device running either the existing software version or the version from a specific IPSW software image loaded from an external system.
Thanks for this.
Isn't another issue with "Erase all Content and Settings" and THEN attempting a restore or restore with a specific IPSW is that when you plug in your phone to Finder/iTunes after erasing, you won't be given that option? You will be shown the "new iPhone" screen which only prompts you to set up as new or restore a backup.