He means erase/wipe as in one of the these;
rm /mountpoint/of/partition/* -rf
mkfs.ext4 /dev/partition
and not as in
dd if=/dev/zero of=/dev/partition
The difference is that with the former 2, you end up with an intact filesystem on the device, and with the latter, you have a completely blank (unformatted) partition.
When you write a userdata or cache image to an android device, it is literally an image of a formatted filesystem with nothing in it.
And you can make such an image like this;
dd if=/dev/zero of=partition.img bs=1 count={size in bytes}
mkfs.ext4 partition.img
When you run the factory reset option on an android device (system settings → system → advanced → reset options → factory reset), what it does, is it reboots into recovery with a command that causes it to format the userdata, and possibly cache filesystems.
When I’m working with a dev board, I’ll usually do a quick and dirty factory reset on an online system using the following;
[user@workstation ~]$ adb shell
$ su
# cd /data
# rm * -rf
# sync
# reboot