Ask a recruiter about the repercussions of taking a counter offer and you'll likely be told that an asteroid will hit not only your home but the homes of everyone you love as well.
Fact is you can get an offer from another employer, take the counter offer from your current employer and still emerge from the burning embers that was your abode in one piece. Your job is about as safe as it was before. For most of us, your job is safe UNTIL IT ISN'T.
Your current employer will keep you for as long as they need you. As long as your exit would make life miserable for your current supervisor, they won't look for a reason to fire you.
(Wow...that's the good news)
But here's the bad news. If your current supervisor comes to have even marginal feelings about your value, they'll remember you held them hostage for more money. (and that's how they'll remember it). And if your supervisor goes elsewhere, their boss remembers what went down when you almost left.
Keep in mind, if you're earning a professionals salary and you can't quantify the revenue you bring into the organization, your less expensive replacement is out there. If this sounds like the words of a pessimist, you're shielding yourself from some painful truths.
It's a form of economic Darwinism that has always existed but has grown exponentially. Information technology has finally delivered on the increases in productivity it promised for years. In some cases, people can do your job from a desk overseas. Public companies put shareholder value over everything- including profitability. Private employers have taken note of all of the above and have a number on your back specific to the bottom line.
A small handful of people are seemingly protected..you probably know a few. They've been at the current job for 10, 15, 20 years. They've either been designated as irreplaceable or they are THE ROCKET SCIENTISTS of playing company politics. They may not like kissing all the right asses at every turn but they like it better than the alternative: finding another job that covers their needs.
For an overwhelming majority of the labor force: you're a free agent. There's some upside to all this. Figure out what's best for you because the entity that is your employer is in a constant state of doing just that. The bright side is if you're good at what you do, you'll earn comparatively more money in this market of bidders for your services than you would have staying at the same job in an earlier generation.