There is a lot that goes on in chapter 23 of The Scarlet Letter. Rather than a slow and decelerating denouement, we get everything from disclosures, to scandal, to coming of age, to justice served, to justice denied. This is what is so awesome about this novel: the best is definitely left for last.
The disclosure, of course, comes from Dimmesdale, who finally exposes the letter that he has carved in his chest, which is the symbol of the guilt and self-punishment that he has suffered as a result of his affair with Hester and, most importantly, the fact that he has fathered Pearl in secret.
Having carried this burden like albatross for so many years has left its dent in Dimmesdale physically, mentally, and emotionally. The man is nothing but a figment of what he once was, now all wasted away and ill. This is the price of sin and guilt in one who is himself a leader in his religious community.
When this scandal occurs at the scaffold, Pearl feels sorry for Dimmesdale and proceeds to kiss him out of mercy. However, there is yet another dimension to this act:
A spell was broken. The great scene of grief, in which the wild infant bore a part, had developed all her sympathies; and as her tears fell upon her father's cheek, they were the pledge that she would grow up amid human joy and sorrow, nor for ever do battle with the world, but be a woman in it.
There is a need for this to happen. It completes the circle, redeems the characters, and also liberates them. Pearl's role as an "imp", "elf" and punisher of her mother's deeds is now over.
Towards her mother, too, Pearl's errand as a messenger of anguish was all fulfilled.
She is no longer a "preternatural creature" born out of evil actions. She has been recognized, she has now forgiven and she is now a woman and not "Pearl the child". She kisses Dimmesdale because she has outgrown the anger and secrets of the past. It is all behind her now.