"Then the king sent for Shimei and said to him, 'Build yourself a house in Jerusalem and live there, but do not go anywhere else. The day you leave and cross the Kidron Valley, you can be sure you will die; your blood will be on your own head.' Shimei answered the king, 'What you say is good. Your servant will do as my lord the king has said.' And Shimei stayed in Jerusalem for a long time." NIV translation
Shimei had been an enemy of David's but David had showed mercy on him by promising that he would not kill him for his betrayal. Solomon offered him a chance to live as long as he stayed in Jerusalem so that he could be watched. By handling it this way (with wisdom), Solomon would not be guilty of shedding the man's blood when required. It is much the same way with all men in that Jesus has offered us a refuge from sin in Him. If we refuse it, the blood guilt is on our own heads.
"But three years later, two of Shimei's slaves ran off to Achish son of Maacah, king of Gath, and Shimei was told, 'Your slaves are in Gath.' At this, he saddled his donkey and went to Achish at Gath in search of his slaves. So Shimei went away and brought the slaves back from Gath." NIV translation
We are reminded that throughout the Bible the number three is associated with the earthly display of God's will and after three years Shimei left Jerusalem. We notice that he left because of his love for money and disobeyed the orders of King Solomon.
This is a picture of the fact that many will reject the grace of God for the pursuit of earthly riches. Shimei forgot that the penalty for leaving was death and so he would not own the slaves anymore anyway. It is the same way with people today in that the devil will distract many people with wealth from this world and they forget that the things of this world are only temporary. In chasing wealth, they turn and run from the saving grace of Jesus Christ towards an eternity in hell.
"When Solomon was told that Shimei had gone from Jerusalem to Gath and returned, the king summoned Shimei and said to him, 'Did I not make you swear by the Lord and warn you, "On the day you leave to go anywhere else, you can be sure you will die"? At that time you said to me, "What you say is good. I will obey." Why then did you not keep your oath to the Lord and obey the command I gave you?'" NIV translation
King Solomon confronted Shimei with the fact that he had broken his oath to God. This oath was based on the principle of the Cities of Refuge which was given to Moses by God before Israel entered Canaan. These cities were a place where murderers could stay until they were put on trial. If they left the city at any time before their trial, they could be killed.
This is a picture of the fact that our refuge is in Christ. He stood trial on our behalf and so we can now walk in freedom. We are no longer confined to a religious system such as the Cities of Refuge.