In which part of iOS is the auto-erase feature implemented and how does it work?
When a wipe occurs, the file system key is deleted. It's as simple as that.

Page 11 of the September 2015 iOS Security White Paper states that the file system key is stored in NAND.


  The metadata of all files in the file system is encrypted with a random key, which is created when iOS is first installed or when the device is wiped by a user. The file system key is stored in Effaceable Storage.





  Effaceable Storage: A dedicated area of NAND storage, used to store cryptographic keys, that can be addressed directly and wiped securely. While it doesn’t provide protection if an attacker has physical 
  possession of a device, keys held in Effaceable Storage can be used as part of a key hierarchy to facilitate fast wipe and forward security.