It's a logical question. To be clear, I pay programmers well. In my experience, however, employees base loyalty on more than wages. In no particular order, employees are more likely to stay if they are well compensated, receive good/great benefits, given flexible hours, have the opportunity to advance, get to work with new and interesting technology, regularly receive training and attend industry conferences, and feel appreciated, respected, and acknowledged.
If I offer (and deliver) all of that to a programmer and he chooses to leave for a higher salary, I will attempt to match the salary if he's a dedicated employee and if not, we're better off parting ways. I do my best to prevent employees from looking for higher salaries.
If your companys customers can get a better deal elsewhere they leave, too.
Absolutely true, but "deal" is the key word there. As with employee loyalty, customer loyalty is based on the whole package offered and delivered. If a company's prices are 5% higher than a competitor's, but that company provides better service, response time, benefits, and quality, customers will stay. While price may be their first consideration, it is not their only consideration.
I have always found that beside pay, thinking is the most important. Engineers want to think, to find solid solutions. They need the time to think, the place to think, and the tools with which to try out their thinking. Unfortunately for engineers, business think loud “collaborative” environments, which are cheap for the company, work. Or that fast paced, “just get ‘er done”, environments are productive.