Shame collapses the difference between what you did and who you are. It turns a single action into a whole identity, and it does this quickly, quietly, and with great authority.
Compassion doesn't excuse mistakes. It just refuses to let a mistake decide who you are. It says: I did that, and I am also the person who can look at it clearly, learn from it, and try again.
This is the paradox self-compassion research keeps finding: people who are kinder to themselves after failing don't try less. They try more, because they aren't spending all their energy defending against their own inner attacks.