Ch. 17 is one of the best-known Bible stories, but I must say it is usually interpreted rather oddly. The Deuteronomic history is mostly about war, to the point of being very tiresome. You will notice that battles are fought hand-to-hand, with swords and spears. The spears are not thrown, but thrusted. The bow and arrow seems not to have come to Canaan. However, there is a single mention of slings as weapons of war in Judges 20, when the Benjamites are about to get massacred by the rest of the Israelites:
I don't know why it matters that they were lefthanded, but anyway, people are obviously aware that slings can be wielded in combat. So this is not, as commonly presented, a tale of the doughty underdog little guy triumphing by guile. Either Goliath and the rest of the Philistines are so stupid it never occurs to them that somebody might hit the big fellow with a slingstone; or David is cheating, and the rules of single combat are that you have to fight hand-to-hand. Either way it's certainly no miracle and David didn't need any help from God. I have looked it up and yes, it is certainly possible to sling a stone hard enough to knock a man out.
There is a major continuity problem. At the end, Saul does not recognize David, apparently has never heard of him, and David has to introduce himself. But Saul knows David very well. 1 Samuel 16 (KJV):
17 Now the Philistines gathered their forces for war and assembled at Sokoh in Judah. They pitched camp at Ephes Dammim, between Sokoh and Azekah. 2 Saul and the Israelites assembled and camped in the Valley of Elah and drew up their battle line to meet the Philistines. 3 The Philistines occupied one hill and the Israelites another, with the valley between them.
4 A champion named Goliath, who was from Gath, came out of the Philistine camp. His height was six cubits and a span. 5 He had a bronze helmet on his head and wore a coat of scale armor of bronze weighing five thousand shekels; 6 on his legs he wore bronze greaves, and a bronze javelin was slung on his back. 7 His spear shaft was like a weaver’s rod, and its iron point weighed six hundred shekels. His shield bearer went ahead of him.
8 Goliath
stood and shouted to the ranks of Israel, “Why do you come out and line
up for battle? Am I not a Philistine, and are you not the servants of
Saul? Choose a man and have him come down to me. 9 If
he is able to fight and kill me, we will become your subjects; but if I
overcome him and kill him, you will become our subjects and serve us.” 10 Then the Philistine said, “This day I defy the armies of Israel! Give me a man and let us fight each other.” 11 On hearing the Philistine’s words, Saul and all the Israelites were dismayed and terrified.
12 Now David was the son of an Ephrathite named Jesse, who was from Bethlehem in Judah. Jesse had eight sons, and in Saul’s time he was very old. 13 Jesse’s three oldest sons had followed Saul to the war: The firstborn was Eliab; the second, Abinadab; and the third, Shammah. 14 David was the youngest. The three oldest followed Saul, 15 but David went back and forth from Saul to tend his father’s sheep at Bethlehem.
16 For forty days the Philistine came forward every morning and evening and took his stand.
17 Now Jesse said to his son David, “Take this ephah of roasted grain and these ten loaves of bread for your brothers and hurry to their camp. 18 Take along these ten cheeses to the commander of their unit. See how your brothers are and bring back some assurance from them. 19 They are with Saul and all the men of Israel in the Valley of Elah, fighting against the Philistines.”
20 Early
in the morning David left the flock in the care of a shepherd, loaded
up and set out, as Jesse had directed. He reached the camp as the army
was going out to its battle positions, shouting the war cry. 21 Israel and the Philistines were drawing up their lines facing each other. 22 David left his things with the keeper of supplies, ran to the battle lines and asked his brothers how they were. 23 As he was talking with them, Goliath, the Philistine champion from Gath, stepped out from his lines and shouted his usual defiance, and David heard it. 24 Whenever the Israelites saw the man, they all fled from him in great fear.
25 Now
the Israelites had been saying, “Do you see how this man keeps coming
out? He comes out to defy Israel. The king will give great wealth to the
man who kills him. He will also give him his daughter in marriage and will exempt his family from taxes in Israel.”
26 David asked the men standing near him, “What will be done for the man who kills this Philistine and removes this disgrace from Israel? Who is this uncircumcised Philistine that he should defy the armies of the living God?”
27 They repeated to him what they had been saying and told him, “This is what will be done for the man who kills him.”
28 When Eliab, David’s oldest brother, heard him speaking with the men, he burned with anger
at him and asked, “Why have you come down here? And with whom did you
leave those few sheep in the wilderness? I know how conceited you are
and how wicked your heart is; you came down only to watch the battle.”
29 “Now what have I done?” said David. “Can’t I even speak?” 30 He then turned away to someone else and brought up the same matter, and the men answered him as before. 31 What David said was overheard and reported to Saul, and Saul sent for him.
32 David said to Saul, “Let no one lose heart on account of this Philistine; your servant will go and fight him.”
33 Saul replied,
“You are not able to go out against this Philistine and fight him; you
are only a young man, and he has been a warrior from his youth.”
34 But David said to Saul, “Your servant has been keeping his father’s sheep. When a lion or a bear came and carried off a sheep from the flock, 35 I went after it, struck it and rescued the sheep from its mouth. When it turned on me, I seized it by its hair, struck it and killed it. 36 Your servant has killed both the lion and the bear; this uncircumcised Philistine will be like one of them, because he has defied the armies of the living God. 37 The Lord who rescued me from the paw of the lion and the paw of the bear will rescue me from the hand of this Philistine.”
Saul said to David, “Go, and the Lord be with you.”
38 Then Saul dressed David in his own tunic. He put a coat of armor on him and a bronze helmet on his head. 39 David fastened on his sword over the tunic and tried walking around, because he was not used to them.
“I cannot go in these,” he said to Saul, “because I am not used to them.” So he took them off. 40 Then
he took his staff in his hand, chose five smooth stones from the
stream, put them in the pouch of his shepherd’s bag and, with his sling
in his hand, approached the Philistine.
41 Meanwhile, the Philistine, with his shield bearer in front of him, kept coming closer to David. 42 He looked David over and saw that he was little more than a boy, glowing with health and handsome, and he despised him. 43 He said to David, “Am I a dog, that you come at me with sticks?” And the Philistine cursed David by his gods. 44 “Come here,” he said, “and I’ll give your flesh to the birds and the wild animals!”
45 David said to the Philistine, “You come against me with sword and spear and javelin, but I come against you in the name of the Lord Almighty, the God of the armies of Israel, whom you have defied. 46 This day the Lord will deliver you into my hands, and I’ll strike you down and cut off your head. This very day I will give the carcasses of the Philistine army to the birds and the wild animals, and the whole world will know that there is a God in Israel. 47 All those gathered here will know that it is not by sword or spear that the Lord saves; for the battle is the Lord’s, and he will give all of you into our hands.”
48 As the Philistine moved closer to attack him, David ran quickly toward the battle line to meet him. 49 Reaching
into his bag and taking out a stone, he slung it and struck the
Philistine on the forehead. The stone sank into his forehead, and he
fell facedown on the ground.
50 So David triumphed over the Philistine with a sling and a stone; without a sword in his hand he struck down the Philistine and killed him.
51 David ran and stood over him. He took hold of the Philistine’s sword and drew it from the sheath. After he killed him, he cut off his head with the sword.
When the Philistines saw that their hero was dead, they turned and ran. 52 Then the men of Israel and Judah surged forward with a shout and pursued the Philistines to the entrance of Gath and to the gates of Ekron. Their dead were strewn along the Shaaraim road to Gath and Ekron. 53 When the Israelites returned from chasing the Philistines, they plundered their camp.
54 David took the Philistine’s head and brought it to Jerusalem; he put the Philistine’s weapons in his own tent.
55 As Saul watched David going out to meet the Philistine, he said to Abner, commander of the army, “Abner, whose son is that young man?”
Abner replied, “As surely as you live, Your Majesty, I don’t know.”
56 The king said, “Find out whose son this young man is.”
57 As
soon as David returned from killing the Philistine, Abner took him and
brought him before Saul, with David still holding the Philistine’s head.
58 “Whose son are you, young man?” Saul asked him.
David said, “I am the son of your servant Jesse of Bethlehem.”