Memory Release After Custom ROM Flash
Like what you said, wiping /data is equivalent to factory reset - you will lose installed apps, system settings, etc. - basically all you've done to the phone since the last reset - BUT minus internal storage contents (i.e. music, video, whatever you can see when you connect your phone to the computer). Unless the recovery explicitly states "wipe /data/media", it should never wipe internal storage.

Also, wiping /data will not touch /system, therefore the OS is preserved. You can choose to manually format it should the need comes up. However, when you flash a new custom ROM, /system will be altered. The default behaviour in older custom ROMs is adding what's in the custom ROM package to /system (stuff from the prior ROM will remain), but as of now the norm is just fully overwriting /system with the new package, which is faster and saves you a step of wiping /system.