Some people even apply for that other job just to get a counter offer. You have a better negotiation position for salary and benefits if you actually have a job offer somewhere else. While you should think that valuable employees should be in a good negotiation position in the first place, employers often don't see the value before they realize that they may lose the employee.
This tactic is of cause risky if you actually like your current job, since the counter offer may not come after all.