Memory Release After Custom ROM Flash I flashed custom rom on my device,and while doing so by recovery,there were some steps,viz. 
1.wipe data
2.wipe cache partition
3.install zip.
My question is what does wipe data actually do? I know that it takes back my phone to factory version. But does wiping data,or wiping cache partition means that all of my device's internal memory is released, i.e is my device's default o.s is also gone ??
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.