What is a custom ROM?
Google releases the source code for Android via the Android Open Source Project (AOSP), which allows anyone to download the source code for stock Android and modify it to their liking. Many people add features or try to further optimize the operating system to improve performance. When people talk about flashing ROMs, they are referring to overwriting the old version of Android that is installed and replacing it with a third party alternative, like CyanogenMod. This sounds sketchy in a way, but just because the ROM is supported by the community, rather than a commercial entity, it does not mean that they are any less stable. In my experience, custom ROMs have been just as stable if not more so than OEM supplied ROM, depending on the ROM of course.