The situation with Nabal is interesting. David's take on the matter: “Blessed be the Lord who has avenged the insult I received at the hand of Nabal, and has kept back his servant from wrongdoing” (25:39). I think there must have been much more going on here than a mere insult. There is the note in 25:21 that David had guarded Nabal’s herds and property in the wilderness, and for this, Nabal had returned to him evil.
And, certainly, in all this, David proves himself to be more worthy than Saul as king. Saul was constantly reacting against perceived slights by trying to kill David. David, on the other hand, shows constraint and holds back from killing Nabal. Now, Saul’s death is upon us. David is soon to succeed to the throne. Surely, years later, David found himself reflecting on these episodes and God’s protection when he wrote
I know that the Lord saves his anointed;
he will answer him from his holy heaven
with the saving might of his right hand.
Some trust in chariots and some in horses,
but we trust in the name of the Lord our God.
They collapse and fall, but we rise and stand upright.
O Lord, save the king! (Psalm 20:6-9)