So they defeated them by God's permission, and David killed Goliath. God gave him kingship and wisdom and taught him what He willed. Had God not restrained some people by means of others, the earth would have been corrupted. But God is bountiful to the worlds.
فَهَزَمُوهُم بِإِذْنِ اللَّهِ وَقَتَلَ دَاوُودُ جَالُوتَ وَآتَاهُ اللَّهُ الْمُلْكَ وَالْحِكْمَةَ وَعَلَّمَهُ مِمَّا يَشَاءُ ۗ وَلَوْلَا دَفْعُ اللَّهِ النَّاسَ بَعْضَهُم بِبَعْضٍ لَّفَسَدَتِ الْأَرْضُ وَلَـٰكِنَّ اللَّهَ ذُو فَضْلٍ عَلَى الْعَالَمِينَ
Fahazamoohum biithni Allahi waqatala dawoodu jaloota waatahu Allahu almulka waalhikmata waAAallamahu mimma yashao walawla dafAAu Allahi alnnasa baAAdahum bibaAAdin lafasadati alardu walakinna Allaha thoo fadlin AAala alAAalameena