Let me see if I can explain "rooting"
This isn't a perfect analogy, but it works...
Using a PC as an example... if you install windows on a PC, there will be a bunch of files put on your hard drive that understands how to make the the processor, memory, video card, etc in the PC work. This is similar to what had been done on your phone except that instead of a hard drive a solid state flash is used for persistent memory (persistent memory or ROM holds its value when powered off). This is different ROM then your SDCard.
If I take that same PC, erase everything and then install Linux, which also knows how to make all of that hardware work, the computer works, but things are different. You could say that you just "rooted" the PC as the term is used with Android.
To get back to Windows I could restore the hard drive from a backup and it would work exactly as it did before Linux was installed.
The difference is that rooting typically uses the same operating system with some tweaks to make things operate differently. If you have a backup of the old software, you can reflash the ROM and it will be back to where it was when you started. Note that you would also have to restore the SDcard to get things back to where they were... think of the sdcard as a second hard drive in your phone.
So rooting consists of optional back up an image of the flash memory in your phone and then installing some other software by flashing the ROM inside your phone. To get back you can just reinstall from your backed up ROM.
Hope this helps,
Chad