When you tap delete on your Android phone, a file might disappear from your view. But it's not really gone. You've erased the index of that file, but the file itself is still in the phone's storage.
Resetting your Android device to factory settings erases all data on the device and clears out unnecessary files. The reset process wipes all your information from it, including private data, messages ...