David heard in the wilderness that Nabal was shearing his sheep.
Nabal's vast flocks of sheep and goats would doubtless have been confiscated by roving bands of outlaws had it not been for David's protection.  After all, we learned in  1 Samuel 23 that such marauders even attacked walled towns (Keilah); and without David's wall of protection around Nabal's flocks  (1 Samuel 25:16), there can be little doubt that Nabal's flocks would have been taken away from him.  The man's stupidity in failing to recognize this is amazing.  The fact that David sent ten men to bring back the gift indicates that he certainly expected Nabal to come through with a very generous contribution.