Shared ground
David is under pressure: he is fleeing a revolt and is publicly shamed by Shimei. Abishai treats the cursing as intolerable treason and proposes immediate execution (v.9). David refuses and restrains the “sons of Zeruiah” (v.10), choosing to absorb the insult rather than escalate violence (v.11).
The text also presents David interpreting the moment in relation to Yahweh. David speaks as though Shimei’s cursing is not outside God’s oversight (“Yahweh has said to him,” v.10; “Yahweh has invited him,” v.11). David then holds out a possibility—not a guarantee—that Yahweh will notice his wrong and repay him with good (v.12).
Where interpretation differs (only where needed)
A real question is what David means by saying Yahweh “said” or “invited” Shimei to curse (vv.10–11).
Some take David’s words as meaning God directly told Shimei to do it. On this reading, David sees Shimei’s act as part of God’s intentional discipline of David, so retaliation would be fighting God’s purpose.
Others take it as God allowing it rather than commanding it. On this reading, David is not claiming God authored Shimei’s sin; he is recognizing that God has not stopped it and is choosing to respond without revenge.
A second, smaller question is how strong David’s expectation is in v.12. Some read v.12 as confident hope of reversal; others read it as cautious uncertainty (“it may be”).
Why the disagreement exists
The wording in vv.10–11 can be heard either as direct instruction (“told”) or as permissive involvement (“invited/allowed”), and the passage does not stop to clarify Shimei’s inner motives or whether he had any revelatory experience. Also, David is speaking in a crisis; his language may be theological interpretation rather than a report of how Shimei received a message.
What this passage clearly contributes
Explicitly, the passage shows a king refusing to authorize a quick killing in response to insult (vv.9–11), and grounding that restraint in a view of Yahweh’s governing role over events (vv.10–11). It also shows David comparing threats: the betrayal by his own son is the major crisis, which makes Shimei’s attack seem unsurprising (v.11). Finally, it portrays David’s posture as open-handed toward God’s future action: enduring present shame while leaving room for Yahweh to turn the situation toward good (v.12).