1. Defense or Offense
Which is safer, to stay on defense against one's own enemies, or go on offense against God's enemies? This is David's dilemma in 1 Samuel 23. He is on the run from Saul, and word comes of a Philistine attack. There can be no doubt that justice is at stake: the enemy is stealing grain from the threshing floor, taking by oppression the rightful fruits of others' labor. David's whole career up to this point has been to lead the armies of God against the enemies of God. But now, his men balk: they are on the run from Saul; how can they go and attack the Philistines? After all, isn't that Saul's problem? But David continues to inquire of the Lord, and the Lord continues to direct him to work for justice. So he goes and delivers the people, and comes out ahead--he captures livestock from the Philistines. And then, when the people of the city would have handed David over to Saul to save their own necks, the Lord ensures that David has enough forewarning to escape, and then delivers David in a narrow escape, ironically by calling Saul away with another Philistine attack.
2. Authority
Contrast this with 1 Samuel 24, the first time Saul comes into David's hands in a situation where he could easily have killed him. Saul enters a cave to relieve himself, not knowing David's entire army is hidden there. David's men, in a scene that foreshadows the temptation of Christ, quote God's promises to David, telling him this is the day the Lord promised when he would give all his enemies into his hands. At first David listens, and sneaks up on Saul, but afterward he is "cut to the heart" for even cutting off the corner of Saul's robe. Why? Because as wrong as Saul is, and as unjust as his war against David is, he is still "the Lord's anointed," the God ordained authority over David at that time and the holder of the office of God's representative leading His holy people. As David tells Saul, the Lord is the proper judge between them; if David takes that justice into his own hand, he would accomplish not justice, but vengeance, which belongs to God.
3. Rage
Finally, 1 Samuel 25 completes the picture of justice. This is a matter not of oppression by an enemy, nor of relationship to authority, but a matter of honor and contract between two equal citizens. David's men have protected and helped Nabal's shepherds. In return, he requests a share in Nabal's feast at shearing time. Nabal not only refuses, he insults David. Enraged, David vows death to Nabal and the men of his house. Nabal's wise wife, Abigail, properly appeals to David to wait for the Lord to judge Nabal, so that when he comes into his throne he will not have "bloodguilt" on his conscience. She completely agrees that Nabal is a fool and is in the wrong, but reminds David to trust in the blessing of God which will be even greater for having endured unwarranted insults.

Here is the proper balance in the use of force against injustice. When we have an opporunity to stand up for the weak and oppressed by opposing criminal injustice, we must do so, even at the risk of our own lives, and not stay on the defensive where we think we are safe. But when the injustice is perpetrated by a rightful authority, we must speak truth to that authority, but not act in rebellion, rather trusting in God to judge. Finally, when the injustice is strictly of an economic nature, or we receive a personal offense of insult to our reputation, we must not respond with violence but rather suffer for righteousness sake and entrust ourselves to God to vindicate our cause in His own time.

1 Samuel 23:1