A Stock ROM is the version of operating system (Android) that the manufacturers of a phone provide with the device. This varies from device-to-device. Take for example, MIUI. A phone that Xiaomi makes, comes with MIUI from the factory, which is why, MIUI is called the Stock ROM for that phone. But, Samsung phones and tablet PCs come with Touchwiz, so, the Stock ROM for Samsung devices is Touchwiz.
Stock ROMs are deeply tested and optimized by the manufacturer for a specific device. Unlike independent ROM developers, in most cases, manufacturers have a dedicated software department, which handles the stock ROM, addresses it’s bugs and issues, adds features and is responsible for the software all-together. So, by staying on your stock ROM, you make sure that you get all the latest features and updates the manufacturer implements into the device software, via OTAs. Also, with some brands, the warranty is void once you root and/or move to a custom ROM.
On the flip side though, stock ROMs can be on older versions of Android, full of bloatware, laggy, have unsatisfactory performance, have old security patches, and have more problems which is why you should consider checking out custom ROMs. Maybe you don’t see any problems with your stock ROM, we’d still encourage you to check out some custom ROMs on your device, because in most cases, people flash these because they are better than stock.
We’ve answered “Why do I need a custom ROM?” in a separate post. You can check it out here!