Positive reason: One quality of good developers is that they seek out new knowledge and want to “grow”. At some point, even in a great company, you may run out of ways to do that and you need to move on in order to keep growing.
Negative reason: Employees want to feel valued. If the pay doesn’t keep up with what they are worth, they’re going to feel the need to move on. A counter offer may only confirm that there employer really did know how valuable they were but decided not to pay them for it - until faced with someone giving their notice.