There seems to be some confusion as to what rooting actually does, probably resulting from most guides asking people to follow steps without explaining the steps fully. Here is my understanding of the general process, please jump in and correct where appropriate, hehe (smiley for serious face, hiding some evil laughter).
1. An app wants to do something with root privileges, so it requests it from the OS via "su".
2. su normally checks the app's user (each app has its own user) against a list of users that are allowed to do this (sudoers). For a rooted phone, su is replaced by a customised version that asks "superuser" application.
3. superuser application as installed by the apk, checks against its own list of apps (users), if not granted it asks the human user with the UI.
So the only changes needed are to replace "su" binary, and install the matching "superuser.apk".
Replace su binary must be done with root privileges in the first place. To get these privileges, usually:
1. Connect to a PC with USB cable and use "adb" to login with a debug shell user (adb shell). Sometimes this is enough as the phone grants the debug user root access.
2. If the debug user does not have root privileges, one of several "root exploits" are tried to gain access.
Hopefully this is useful to someone to justify me trying to inflate my ego by looking knowledgeable!