Even though the hardware manufacturers try to put enough restrictions to restrict access to the root, hackers have always found different ways to get access to the root. The process of rooting varies depending on the underlying device manufacturer. However, rooting any device usually involves exploiting a security bug in the device's firmware and then copying the su (superuser) binary to a location in the current process's path (/system/xbin/su) and granting it executable permissions with the chmod command.
For the sake of simplicity, imagine that an Android device has three to four partitions, which run programs not entirely related to Android (Android being one among them).
The boot loader is present in the first ...