King David once watched a wasp devouring a spider while a fool chased them both with a stick. And he complained to God about it. Why create wasps that sting for no benefit? Why create spiders that weave webs they'll never wear? Why create fools who harm everything they touch? Three utterly pointless creatures, David argued. God's response, according to the Alphabet of Ben Sira (c. 700-1000 CE), was sharp: "David, you are slandering My creatures. The hour will come when you will need every one of them."
And that's exactly what happened. Three times, the very creatures David mocked saved his life.
First, the spider. When David hid in a cave from King Saul, God sent a spider to weave a web across the cave's entrance. Saul arrived, saw the unbroken web, and assumed no one could have entered. He moved on. David survived. When he emerged and saw the spider, he kissed her and blessed her Creator. (For another telling of this story, see David Learns to Respect Spiders After God Saves Him.)
Second, the fool. When David stood before King Achish of the Philistines, he pretended to be a raving madman. Since Achish's own daughter was mentally ill, the king was disgusted: "Do I not have enough fools already?" They released David, and he escaped with his life.
Third, the wasp. When David crept past Saul's sleeping general Avner to steal the king's water flask, Avner's legs pinned him like pillars on the way out. David cried out in desperation. God sent a hornet that stung Avner's legs, causing him to shift. David slipped free. The lesson? Never slander God's creation. Everything has its purpose, even if you can't see it yet.
ט He said to him, "Why did the Holy Blessed One create in Their world wasps and spiders, which cause harm and get no benefit from it?" He said to him, "It once happened that David King of Israel, peace be upon him, was sitting in his garden, and he saw a wasp eating a spider, and a fool arrived with a stick in his hand and was chasing them away. David said before the Holy Blessed One: 'Master of the world! What benefit is there to these, which you created in your world? The wasp eats honey and stings, and she gets no benefit from it; the spider weaves all year but he never dresses in it; the fool with no intelligence harms other creatures and does not know your unity and strength, and there is no benefit in him to the world.' The Holy Blessed One said to him: 'David! You are slandering the creatures. The hour will come when you will need them, and you will know why they were created.' And when he hid in a cave because of King Saul, the Holy Blessed One sent a spider, and she wove a web over the mouth of the cave and sealed it. Saul came and saw it woven. He said, 'Certainly nobody has entered here, for anyone entering would have torn the webbing to shreds.' He continued and did not enter there. And when David exited and saw the spider, he kissed her and said to her, 'Blessed is your Creator and blessed are you! Master of the world, who can compare to your workings and strength? For all you make is good.' And before Achish, he made himself out to be a fool before his men, and Achish's daughter was an insane fool, so when they brought him [David] to him, he [Achish] said to them, 'Are you mocking me? Is it because of my daughter who is a fool that you brought this to me? Or maybe I do not already have enough fools?' Immediately, they released him, and he escaped and gave thanks to God for his deeds, for everything that he created in the world has benefit in it. And when David found Saul lying down at noontime, Avner was lying at the entrance, with his head at one entrance and his legs outstretched, and he [David] came and entered between his legs and took the water flask. And when he went to leave between his legs, Avner stretched his legs and covered him with them, and they were over him like two great pillars. And he asked for mercy from Hashem, and said, 'My God, my God, why have you forsaken me?' At that moment, a miracle was done for him, and sent him a hornet, and she bit Avner's legs, and he straightened them, and David exited and praised the Holy Blessed One. And it would be inappropriate for a human to slander God's doings."