I work as a recruiter and one of the worst things someone can do while leaving a position for a new job is to accept a counter offer. I see a lot of posts here about how someone will threaten to quit or will put there 2 weeks notice in because their bosses are dick heads, And then we'll be offered a raise or something for them to stay at their current position. I'm telling you now, it's a terrible idea to take a counter offer. 80% of people who accept counter offers are back in the job market within 6-12 months of accepting that counter offer. Employers will sometimes only offer a counter offer to keep you until they can find a replacement, and sometimes they will treat you poorly because they feel like they can't trust you to be loyal to their company. Most people who accept counter offers end up back in the job market because money isn't the biggest factor and why you might be looking for a new job. A raise and salary is not going to change how poorly your boss does their job, or the workplace drama you experience, or if you had to come back to in person work after enjoying being remote for a long time.
Think long and hard before accepting a counter offer, more often than not it's a really really bad idea to do so.