This resonates with me so much. I've left a few companies after having conversations which ended with my manager saying exactly this. In most cases they have ended up hiring somebody else at a salary higher than mine.
It really confuses me. I usually don't want to leave these companies because the work is good and finding a new job can be stressful. They usually don't want me to leave because I do good work and finding a replacement is costly. I don't understand why all this bureaucracy and nonsense about job titles has to get in the way of finding a middle ground.