The “Erase all content and settings” option in Settings obliterates all the keys in Effaceable Storage, rendering all user data on the device cryptographically inaccessible. Therefore, it’s an ideal way to be sure all personal information is removed from a device before giving it to somebody else or returning it for service.
Important: Don’t use the “Erase all content and settings” option until device has been backed up, as there is no way to recover the erased data. I'd recommend reading through that document if you are interested in the security features of iOS devices. There's a lot more to it, including multiple levels of encryption depending on which types of data, etc.
The above is still true as of iOS 12.3 (https://www.apple.com/business/site/docs/iOS_Security_Guide.pdf).
And here's a user's remarks on that:
All the data on an iOS device is encrypted using strong encryption by default. The keys that are used to encrypted and decrypt our data are stored on the devices. When you choose to "Erase All Content and Settings" the device "obliterates" the keys. So your data is basically still there but no-one can read it anymore. - https://apple.stackexchange.com/a/314118