فهزموهم بٳذن الله
So they routed them by Allah's leave,
meaning, they defeated and overwhelmed them by Allah's aid and support.
Then,
وقتل داود جالوت
and Dawud killed Jalut.
Israelite accounts claimed that (Prophet) David killed Goliath with a slingshot that he had, which he launched at Goliath causing his death.
Talut promised that whoever killed Jalut, would marry his daughter and would share his kingship and authority. He kept his promise. Later, the kingship was transferred to Prophet Dawud in addition to being granted Prophethood by Allah.
So, Allah said:
وآتاه الله الملك
...and Allah gave him (Dawud) the kingdom,
that Talut had and,
والحكمة
and Al-Hikmah,
that comes with the Prophethood, meaning, after Shamwil.
Allah then said,
وعلمه مما يشاء
and taught him of that which He willed.
meaning, what He willed of the knowledge that He bestowed on (Prophet) Dawud.
Next, Allah said:
ولوﻻ دفع الله الناس بعضهم ببعض لفسدت اﻻرض
And if Allah did not check one set of people by means of another, the earth would indeed be full of mischief.
This Ayah indicates that if it were not for the fact that Allah checks one set of people with another, such as when Talut and the bravery of Dawud helped the Children of Israel (against Goliath), then people would have perished.
Similarly, Allah said:
ولوﻻ دفع الله الناس بعضهم ببعض لهدمت صومع وبيع وصلوت ومسجد يذكر فيها اسم الله كثيرا
For had it not been that Allah checks one set of people by means of another, monasteries, churches, synagogues, and Masjids, wherein the Name of Allah is mentioned much, would surely, have been pulled down. (22:40)
Allah then said:
ولكن الله ذو فضل على العالمين
But Allah is full of bounty to the Alamin (mankind, Jinn and all that exists),
meaning, by His mercy and favor He fixes some of them by some others. Surely, Allah has the wisdom, the supreme authority and the clear proof against His creation in all of His actions and statements.
Allah said:
تلك آيات الله نتلوها عليك بالحق وإنك لمن المرسلين