I am a big fan of Herzberg's dual factor theory. I find it much more practical and actionable than the ubiqitous Maslow's hierarchy.
In one of my previous jobs, I asked people in my team to make a survey to identify their motivational and hygienic factors. The surprising result for me was how much variation there was among different people. (e. g. for somebody salary was a motivational factor, for anybody hygienic one). Anyway, understanding these factors for individual team members made me much more effective manager.
Generally by the time engineers start thinking about money you've already lost them.
My rule of thumb has always been that when I start thinking "I'm not getting paid enough to put up with this", it's time to move on whatever happens.