As director of engineering, I gladly gave generous raises to retain people, because it cost way more in lost productivity to read resumes, interview candidates, and onboard new devs, not to mention the $30k check you have to write to the recruiter. And you're right, one bad hire can be disastrous...apparently the guy that replaced me wanted to prove his value by rewriting the whole architecture. So they spent a whole year doing that which I'm sure is much cleaner than the original under the hood, but to the end user, it is not apparent.