When rooting android device, what is changed in device? Not a Duplicate Claim

If you are tempted to flag this as a duplicate of questions like "How to root my android phone?" or "What can I do with a rooted android device?", then please take the time to read my question carefully. My question is not about those topics.

Question

Out of couriosity, what is changed inside of an android device when it gets rooted? Is it saved somewhere, like in a config file with rooted=true or something like that?

I've extensively tried to google for this, but the information I'm looking for seems to be hidden behind all the results for how to root which phone and what fancy things you can do with a rooted phone, so I couldn't find it. Not even a clue.
Although this article is somewhat old (2011), it goes over the concept of rooting and how rooting is done. Rooting is basically exploiting a security flaw (in phones which do not have have it exposed to public unlike the Nexus line of devices) to get the phone to execute code not from the manufacturer.

http://seasonofcode.com/posts/how-rooting-works-a-technical-explanation-of-the-android-rooting-process.html