Difference between formatting & wipe
A factory reset won't remove a custom ROM unless the backup image in the custom ROM is for a ROM other than itself.  This would be pretty unlikely.

I think we'd need to know your phone model and the ROM you used to help you figure out why it didn't write over the system apps.  That's definitely not normal.  Normally virtually no trace of the old ROM should be left.