David probably picked up five smooth stones to kill Goliath because Goliath had four relatives. In that ancient culture, there was a phenomenon called "blood revenge." If a person were to harm another person, often times a relative would come and take vengeance on the offender. Then, it might occur where retaliation was made, and then more relatives got involved on both sides, and an escalation of violence often followed. David knew that if he would defeat Goliath, he would also have to deal with his relatives.
"And David girded his sword over his armor and tried to walk, for he had not tested them. So David said to Saul, “I cannot go with these, for I have not tested them.” And David took them off. 40 And he took his stick in his hand and chose for himself five smooth stones from the brook, and put them in the shepherd’s bag which he had, even in his pouch, and his sling was in his hand; and he approached the Philistine," (1 Samuel 17:39-40).
"And there was war at Gath again, where there was a man of great stature who had six fingers on each hand and six toes on each foot, twenty-four in number; and he also had been born to the giant. 21 And when he defied Israel, Jonathan the son of Shimei, David’s brother, struck him down. 22 These four were born to the giant in Gath, and they fell by the hand of David and by the hand of his servants," (2 Samuel 21:20-22).