If you take a look at the sudo binary you will see it has the setuid permission bit set on the executable. This indicates to the kernel that it should always be executed with the uid of the owner of the executable file, in the case of sudo that is root. Once sudo is running as root it can do the necessary authentication and a setuid-syscall before the fork/exec.
---s--x--x. 2 root root 219272 Jul 17 2012 /usr/bin/sudo
If you note the 's' and the owner you will see what I mean.