So they defeated them by Allah’s Will, and David killed Goliath. And Allah blessed David with kingship and wisdom and taught him what He willed. Had Allah not repelled a group of people by ˹the might of˺ another, corruption would have dominated the earth, but Allah is Gracious to all.
— Dr. Mustafa Khattab, the Clear Quran
So they defeated them by permission of Allah, and David killed Goliath, and Allah gave him the kingship and wisdom [i.e., prophethood] and taught him from that which He willed. And if it were not for Allah checking [some] people by means of others, the earth would have been corrupted, but Allah is the possessor of bounty for the worlds.
— Saheeh International