If they didn't recognize your value before and they only recognize it when you threaten to depart, they aren't respecting you any more w/the counter; they're just using that to stave off the impending issues that arise and will likely take any future opportunity to recoup that 'loss'.
I actively advocate, in advance, for my team. They have clear expectations on what the next step in their career w/us is and have a general idea of what to expect salary wise when they reach it. If they're looking, it means that I have failed them in my #1 core competency and priority as a leader to ensure they are getting what they need out of their day to day and I would prefer they openly communicate with me in advance of their feeling a need to look.
If you are not getting this out of your current leadership, find a new job where your leader will be someone will be that advocate for you. Very often, people are a company's most valuable asset and they should work hard to retain that asset without rigamarole.