I have never seen a situation where a company made a counter-offer to stay worked out in the long run. Either the person turned it down, accepted it but left anyway a year later, or the company was just buying time to find a replacement without a gap. There was always hard feelings involved.
Regarding the salary increase, that depends on a lot of variables. If you are below the salary range for that role, by all means ask for a raise, If you are at the bottom of the range and have a good performance review, ask for a raise. If you are in the middle or upper part of the range, asking probably won't do any good unless you can argue for a grade increase (e.g., quality engineer to senior quality engineer). In all the companies at which I have worked, there were only three ways to get an increase:
- Annual merit increase - these are usually small and the manager is typically given a fixed pool of money that they have to divvy up amongst their team. If you get more, someone else gets less. A fair manager will give high achievers more and low performers less, but lazy managers will give everyone the same percentage.
- Developmental increase - this is when you get a promotion and a pay increase. The amount will depend on the new pay bracket and frankly whether or not your boss tries to low ball you at the bottom of the range.
- Market adjustment - Most larger companies will survey what other companies are paying for a similar role in the same area. If the pay range is lagging behind what most companies in the area are paying, the company will make a market adjustment. If that adjustment causes you to drop below the bottom of the range, you can ask for a raise.