An expression of gratitude and modest surprise used when someone has given a gift or done a favor, implying that the action was unnecessary but appreciated.
2.
globalneutralcolloquial
A mild admonition indicating that someone ought not to have performed a particular action; a comment that the action was inappropriate or mistaken.