Oh, I suppose you were really asking about the rooting step itself. I'm not entirely sure what it does, but it includes installing the "su" app itself (which prompts/grants per-app etc..) and giving that app the required superuser privilege.

In my understanding, custom firmware isn't part of the "rooting", but to get to the point where rooting is possible, one has to first "unlock" the bootloader. That latter step involves custom firmware.

Cheers