Isn't it strange how you somehow become more appreciated, and offered more money when you are about to leave.
If you were truly happy in your current job, and with the pay rise, then you would not be considering leaving.
Obviously this new firm wanted you otherwise they would not have...