Summary: The Philistines gathered to wage war with the Jewish people putting forward their ultimate soldier, Goliath to taunt his opponents to fight him. Saul was very frightened and his fear spread to the rest of his camp. In the meantime, Yishai asked his son David to take provisions to the camp.
When he arrived he heard Goliath cursing God and the Jewish people and also saw the fear that had spread throughout the Jewish army. David immediately volunteered himself to fight Goliath, even refusing to wear Saul’s armour. He confronted Goliath and killed him by firing a stone at Goliath’s head. The Philistines fled when they saw that Goliath had been slain.
A deeper look: The Mishnah teaches that when the Jewish army went to war, the Kohen who led them (see Deuteronomy 20:2) would recite the Shema in order to invoke its special merit with God. Goliath approached the army every morning and evening (Samuel I 17:16) and goaded them to find a man willing to fight him (ibid. 17:8). The Gemara understands that when Goliath approached them every morning and evening, it was to try to distract the Kohen from saying Shema and remove this merit from the people. Furthermore, the taunts to find a man to fight him referred to fighting God himself (Sotah 42b).
When David heard the curses against God and the desecration of His name he volunteered himself to fight. He refused to wear Saul’s armour in order to show the people that it was God who would deliver them, not the might of man (Samuel I 17:47). When David’s stone penetrated Goliath’s forehead, he fell forwards rather than backwards (ibid. 17:49). This miracle was to ensure that the mouth that had defiled God’s name would become filled with dirt (Midrash Tehillim 18). David’s victory allowed the Jewish army to rout the Philistines into submission.
Yet this victory did more than just punish the Philistines. David was now a celebrated hero and would marry Saul’s daughter, Michal. Saul however developed a burning jealousy towards David which would taint his latter years and define his ultimate downfall.