The years of shepherding turn out not to be filler — they're training nobody watching would have recognized as training. When David arrives at the battle line running an errand for his father and hears Goliath's daily taunt, his objection isn't fear, it's outrage: "who is this uncircumcised Philistine, that he should defy the armies of the living God?" (1 Samuel 17:26). Saul offers his own armor, and David tries it and takes it off — it isn't his, and he knows better than to fight in someone else's fit. What he brings instead is a sling, five stones, and an argument he's already tested: "thy servant slew both the lion and the bear... this uncircumcised Philistine shall be as one of them" (1 Samuel 17:36). Watch the theology David states out loud before the stone ever leaves the sling: "the battle is the LORD's" (1 Samuel 17:47). This isn't false modesty. It's the same conviction that let him face a lion and a bear alone in a field with nobody watching, long before anyone handed him a crowd to perform for.
Worth knowing plainly: the city of Gath, Goliath's home, has been excavated, and archaeological work there has turned up material culture consistent with a real Philistine city of roughly the right period — the kind of textured, checkable backdrop John Lennox would tell you is exactly what you'd expect if Samuel is remembering real geopolitics rather than inventing a folk tale. That doesn't settle every question about the size of the stone or the size of the man, but it should stop you from filing the whole episode under legend before you've actually looked at what's been dug up.