Yes. And that's why every employee should spend some low amount of background effort constantly interviewing elsewhere. First, to get a feeler for what the rest of the market is doing. Second, to take a better offer if available. Third, even a committed lifer needs to keep the interviewing skills sharp, in case of layoffs or bankruptcy.
You do realize that it costs companies more to continually hire. If you add real value to a company, from my experience most non-global companies see and understand that. However, in many cases the engineer is mediocre in their job (regardless of actual skill) and still expects a company to increase their pay. In a generation of people that feel something is owed to them, unfortunately the mediocre engineer covers 80% of the talent pool.
There are also places that hamstring their above average developers with processes and/or interruptions that tend to bring down a lot of potential productivity (and morale).
Yes, I do realize. If you keep interviewing, you'll get a sense of how much your talents are worth in the market. (And the mediocre engineer you talk about will see their real worth too.)