David dealt kindly even with people who had opposed him.
v 23. Then, turning to Shimei, David vowed, “Your life will be spared.”
The story of Shimei is a little-known episode in the life of David. It takes us back to the same sorry tale as yesterday – Absalom’s revolt against David. As David and his entourage were fleeing from Jerusalem. this man Shimei hurled violent abuse at David. We find this in 2 Samuel 16, ‘ As King David came to Bahurim, a man came out of the village cursing them. It was Shimei son of Gera, from the same clan as Saul’s family. He threw stones at the king and the king’s officers and all the mighty warriors who surrounded him. “Get out of here, you murderer, you scoundrel!” he shouted at David. ‘ Not a particularly friendly individual! But as David gets back to Jerusalem we meet Shimei again – now deeply regretting his past. ‘ “My lord the king, please forgive me,” he pleaded. “Forget the terrible thing your servant did when you left Jerusalem. May the king put it out of his mind. I know how much I sinned. That is why I have come here today, the very first person in all Israel to greet my lord the king.” ‘ In spite of the advice David receives to have Shimei executed (v 21), Shimei is forgiven.
That is certainly the best way to encourage loyalty.
I do wonder however about the honesty of Shimei’s ‘repentance’’ and how it worked out. You might like to read 1 Kings 2:8-9, where David on his deathbed speaks about Shimei to his son Solomon.