1 Samuel 17:23
And as he talked with them, behold, there came up the champion, the Philistine of Gath, Goliath by name, out of the armies of the Philistines, and spake according to the same words: and David heard them. And as he talked with them, behold, there came up the champion, the Philistine of Gath, Goliath by name, out of the armies of the Philistines, and spake according to the same words: and David heard them.
While David was talking with his brothers, Goliath the Philistine champion came up out of the armies of the Philistines before Israel and repeated his former words of challenge, and David heard them. His challenge was a proud, boastful, self-confident defiance directed against Israel and against Israel's God, backed by his imposing size. His words and appearance filled Israel with fear and terror for forty days.
Israel's terror came from lacking the trust in God that would have given them courage to fight in His name. God would not let an idolatrous nation boast against Him, so He delivered Israel not through Saul but through David, whom He had raised up to rule. David, who later slew Goliath, was stirred on hearing the challenge to defend God's honor and His people.
In contrast to Goliath's self-confidence, David's courage came from believing in God and going in His name. He humbly relied on God rather than on human strength or prepared weapons for victory.