Joab arranged for this woman to speak to King David with a view to bringing Absalom back from exile after he murdered Amnon (because he raped Tamar). Joab and the people wanted David to show Absalom grace and allow him to return to Jerusalem. The woman rather bravely reminds the king that God creates ways to show mercy and therefore David should do likewise.
Some feel that the God of the Old Testament is harsh and legalistic whereas Jesus inaugurated a new covenant of grace. But God has always been a God of grace. In the very beginning we see God, as an act of grace, making garments for Adam and Eve so they were clothed (Genesis 3:21). Here in these verses we see that even God's people in the Old Testament knew that God was merciful and devised ways so that a banished person doesn't remain banished.
God looks for ways to show his grace and reinstate people when they have fallen into sin. Although he is a holy God, he is also merciful. The sacrificial system that God instructed Moses to establish was to teach his people that forgiveness was possible. Failure isn't final.
The ultimate way God devised, so that a guilty person does not remain banished from God's presence forever, was the cross. It was a costly solution to the problem of sin but God orchestrated it to ensure people weren't banished forever.