When using the "top" command in Terminal, you get the PID (process id's) of every program (actually called processes). :)
Now, If you want to, for instance, perform a "kill" command on a specific process, it's a bit cumbersome to use the "top" command and then search for the specific process in question.
With pidof, you can just type "pidof Safari" for example, and it will give you its PID number(s) right away. You can even type "pidof Saf", and it will (in most cases) bring you the actual PID number. But beware of using this abbreviated method too frequently, since it might give you the PID of a process with the same letters, for instance, it might give you the PID of the application Safe Place, and if you mistakenly kill that process, you will not be asked in beforehand, if you want to save its current state, it just kills it, so be wary of that.
Try it out.