 What mattered was his heart, this young man David's heart. Only God can judge that. And God had been preparing David for long before this event. David is out working with the sheep, playing his lyre, so that David would be a king soon.