Retention is one reason. Two other reasons are friction of switching jobs + labor not being highly commoditized.
Friction: If I'm getting paid $80k a year as a junior dev, I'm probably not going to switch to a similar job for $85k - yeah, I'm better off, but it can be a minor pain to switch jobs.
Imperfect markets: in mythical EconLand, if company A is paying a worker $1.50 an hour to make widgets and company B offers $1.500001 an hour, the worker will instantly switch to company B unless A matches the wage. In reality, there's a cost to switching and the worker doesn't know if her manager at B will be a pain-in-the-butt who negates the $0.000001 increase in hourly wage. Friction and asymmetric information like this is one reason we don't see hyper-precise pricing outside highly commoditized goods (EUR/USD spreads, pork bellies, etc.).
Friction: If I'm getting paid $80k a year as a junior dev, I'm probably not going to switch to a similar job for $85k - yeah, I'm better off, but it can be a minor pain to switch jobs.
Imperfect markets: in mythical EconLand, if company A is paying a worker $1.50 an hour to make widgets and company B offers $1.500001 an hour, the worker will instantly switch to company B unless A matches the wage. In reality, there's a cost to switching and the worker doesn't know if her manager at B will be a pain-in-the-butt who negates the $0.000001 increase in hourly wage. Friction and asymmetric information like this is one reason we don't see hyper-precise pricing outside highly commoditized goods (EUR/USD spreads, pork bellies, etc.).