Nah, David was just cracking jokes and Goliath rolled on the floor with laughter shouting, “Stop it Davy, you’re killin’ me!”
The funny thing is, any military theorist from at least B.F. Liddle-Hart on given a description of the combattants and how they were armed would have give odds in favor of David if wagering on the combat: fire and movement!
No miracles there, just a young man with the wit, on the basis of dealing with wild animals dangerous enough that they had to be killed at range or fled from, to understand modern military theory centuries before most of mankind did.