i understand when ur on a custom rom and u flash another you should clear data/cache bbut say if im just going from a custom rom to my stock backup do i still need to clear data/cache
If you are restoring to a backup (nandroid), that will involve overwriting /system, /data, and /cache with the copy in the backup. It's irrelevant whether you erase /data and /cache before restoring, because they are going to be overwritten anyway.
Installing a ROM is different than restoring to a backup because installing only writes to /system (typically)
Cool CM Tricks
custom_backup_list.txt - make a list of files in /system that will survive a nightly install (ringtones, notifications, system apps, wallpapers, whatever)
in Terminal Emulator, set this as your shell command: "/system/xbin/su -c /system/xbin/bash". You get all the features of bash, root access, and you can still use the initial command field for whatever you want (default is adding /data/local/bin to your path)