Offer more to keep employees?

One of my staff members who we have trained and developed from an executive assistant to a financial assistant came to us and said she found another job as a financial assistant and a $20K more. As she has been transitioning from executive assistant to financial assistant, we have gradually increased her pay and assured her to expect more in the near future as she fully transitions. When she came to us we shared that we were going to offer her a higher pay (close to what she is being offered) in a month as she will fully transition to financial assistant. She came back and said that they offered it first and she is accepting the offer.

I have so many thoughts about this and I am having a hard time figuring out how to deal with employees when they come with offers. Is it a good practice to offer or match pay when they ask since we can afford it as a business or let them go?

I do feel betrayed that we gave her these skills and increased her pay and I keep thinking what if I would’ve done something differently.