Steven Pritchard's answer is good, but I thought I'd offer a different presentation of similar information.
Each process runs as a certain user¹. The user is identified by a number, the user ID, which is stored in the process information available only to the kernel. The user whose user ID is 0 has special privileges, and is normally called
root; the name
rootis not special to the kernel (but if you change it you're likely to confuse a lot of applications). Many things, such as loading kernel modules, accessing most hardware devices directly, and so on, require that the process that performs the action be running as user ID 0².
When the system boots, the first process started by the kernel runs as the superuser. That process, called
init, eventually starts a number of system services (
syslogd, …) and login programs (
When you log in, you enter credentials (name, password, …) and the login program checks these. If the credentials are accepted, the login program changes to your user ID (that's one of the privileges granted to the superuser).
If you screw up the user database (which is unlikely if you don't go around editing or removing random files as root), you may not be able to log in any more. You'll still be able to boot into single-user mode or from a live CD to repair your system.
sudo lets you run commands as root. Normally, if you run a program, it inherits the user ID of the process that started it. But
sudo is setuid root: this is an exception, determined by the permission bits on
/usr/bin/sudo, that make it run as user ID 0 instead.
sudo checks whether the user that invoked it is allowed to run a command with elevated privileges (by consulting
/etc/sudoers), and either runs the command or signals an error.
¹ Sometimes more than one, but this won't come up in this answer.
² Or have the right capability, but never mind this for now.