Al-Baqara • EN-TAFSIR-IBN-ABBAS
﴿ فَهَزَمُوهُم بِإِذْنِ ٱللَّهِ وَقَتَلَ دَاوُۥدُ جَالُوتَ وَءَاتَىٰهُ ٱللَّهُ ٱلْمُلْكَ وَٱلْحِكْمَةَ وَعَلَّمَهُۥ مِمَّا يَشَآءُ ۗ وَلَوْلَا دَفْعُ ٱللَّهِ ٱلنَّاسَ بَعْضَهُم بِبَعْضٍۢ لَّفَسَدَتِ ٱلْأَرْضُ وَلَٰكِنَّ ٱللَّهَ ذُو فَضْلٍ عَلَى ٱلْعَٰلَمِينَ ﴾
“And thereupon, by God's leave, they routed them. And David slew Goliath; and God bestowed upon him dominion, and wisdom, and imparted to him the knowledge of whatever He willed. And if God had not enabled people to defend themselves against one another, corruption would surely overwhelm the earth: but God is limitless in His bounty unto all the worlds.”
(So they routed them by Allah's leave) by Allah's help (and David) the Prophet (slew Goliath) the unbeliever; (and Allah gave him the kingdom) Allah gave David sovereignty over the Children of Israel (and wisdom) understanding and prophethood, (and taught him of that which He willeth) i.e. how to make armour. (And if Allah had not repelled some men by others) as He repelled through David the evil of Goliath from the Children of Israel (the earth would have been corrupted). He says: Allah repelled from the believers, by means of the prophets, the evil of their enemies, and He repelled from those who refrained from participating in the fight for Allah's sake, by means of those who fought in His sake, the evil of their enemies. If it were not thus, the earth would have been corrupted. (But Allah is a Lord of Kindness to all the worlds) by this repelling.