Worth noting that this tactic is risky, especially at smaller companies. A lot of managers might get you the raise to avoid immediate disruption, while assuming you're out the door in a few months and acting accordingly. You might suddenly find yourself frozen out of desirable projects.
Yes, it assumes a dysfunctional company that values profitability over keeping engs comfy. But every larger company I know of works like this, due to market forces I suppose.