It isn’t necessarily greed. If you’re doing a great job and getting paid less than the next guy over, who’s doing a ho-hum job, most people’s sense of fairness will be triggered. So they will seek to rectify that unfairness, either by negotiating higher pay, or finding employment elsewhere.