As an HR Leader, I once had a key employee tell me about her dissatisfaction with her role and the desire to leave the company. Without thinking much, almost instinctively, I told her about other companies I knew with open roles matching her skill set she might like, and actually made an introduction to one of them. We went to an Open House at this company together.
I wanted her to be happy, progressing in her career and to feel rewarded. I suppose I don't want to work with people that I know aren't happy. I also wanted to support her. By genuinely listening and trying to help her, I believe I became an ally and could help address her concerns at work. She could explore her options and learn more about her desires and current situation and solutions. She didn't quit. I've since moved on, but she's stayed at the company, worked her way up, and is currently leading the department.
I don't belief a counter offer is a good practice. No company or team should be hamstrung by one person. Business operations should be able to adjust to a loss on the team. Perhaps there are work conditions that are driving the employee away that you can address, but throwing more money at the problem won't fix things.
If an employee is willing to leave, or threaten to leave, they'll likely do it again. More money can delay the problem, but the true lure that drove those employees away will come back around again.