When talking about gaining root for a given device, it usually means obtaining it for the first time by developers. There are generally two ways of doing this. You can either find a software vulnerability that can be exploited to elevate permissions and sneak in the
su (superuser) binary into write-protected system area, or you can flash an image of the device with root already in place. Needless to say, exploiting vulnerabilities is a lot more difficult. This is where fastboot comes in.
On some devices (mostly HTC and Motorola) Fastboot is a special start-up mode that allows you to flash pre-made images onto various internal memory partitions. It is similar to Samsung's "Download" mode, except instead of proprietary software like Kies or Odin (and Heimdall), it uses the fastboot utility that comes standard with Android SDK.
However, flashing can be, and usually is, restricted by device manufacturers to only images signed by the manufacturer themselves (or the carriers). This is what is referred to as bootloader locking. Most new phones ship with locked bootloaders, which makes it impossible to flash custom ROMs. You are back to having to root via the other, more difficult method.
Nexus devices come with unlockable bootloaders, so that you can flash ROMs easily and without restrictions. Unlocking a bootloader of a Nexus device is very easy as well. A pre-rooted image usually surfaces very quickly for these devices after they are released.
It is worth noting that with Android 4.3 (Jelly Bean) and even more so with 4.4 (KitKat) Google has changed some low level OS security policies, which renders old rooting methods obsolete. Unlocking the bootloader and flashing a modified image of the OS that circumvents these new policies will soon become the only way to really achieve root. You can read more about this here.