Generally on a Mac, 'erase' means to destroy all the bits on the storage medium, including the operating system, applications, programs, and user data. On a Mac erase does NOT mean factory reset.
What happens if you erase your Mac?
A factory reset will wipe your Mac computer, restoring its software to the state it was in when you first turned it on. That means that all your personal files and data will disappear.
What happens if you erase the Macintosh HD?
Erasing your Mac permanently deletes its files. If you want to restore your Mac to factory settings, such as when you're preparing it for a new owner, first find out what to do before you sell, give away or trade in your Mac.