ذَٰلِكَ أَن لَّمْ يَكُن رَّبُّكَ مُهْلِكَ ٱلْقُرَىٰ بِظُلْمٍۢ وَأَهْلُهَا غَٰفِلُونَ١٣١
This is because your Lord would never destroy a town for their wrongdoing while its people are unaware [of the truth].
[ ↗ Study from physical print edition ]That is because your Lord would not destroy the cities for wrongdoing while their people were unaware.
[ ↗ Study from physical print edition ]131. The reason for sending messengers to mankind and jinn is so that no one is punished for the crimes they committed without a messenger having been sent to warn them and the invitation reaching them. I only punished a nation after sending messengers to them.
That sending of the messengers is because an phonetically lightened with the lām of li-annahu implied thus read as li-annahu ‘because’ your Lord would never destroy the towns through injustice on their part while their inhabitants were heedless not having had any Messenger to make things clear to them.
The third verse (131) tells us that sending prophets and messengers among human beings and the Jinn is based on the dictate of justice and mercy of Allah Ta` ala for He does not send punishment over a people unless they have been awakened through His blessed messengers and provided with the light of guidance.
Tafsir al-Qurtubi [The Compendium of Legal Rulings]
تفسير القرطبي (الجامع لأحكام القرآن)قَوْلُهُ تَعَالَى: ﴿ذلِكَ﴾ فِي مَوْضِعِ رَفْعٍ عِنْدَ سِيبَوَيْهِ، أَيِ الْأَمْرُ ذَلِكَ. و "إِنَّ" مُخَفَّفَةٌ مِنَ الثَّقِيلَةِ، أَيْ إِنَّمَا فَعَلْنَا هَذَا بِهِمْ لِأَنِّي لَمْ أَكُنْ أُهْلِكُ الْقُرَى بِظُلْمِهِمْ، أَيْ بِشِرْكِهِمْ قَبْلَ إِرْسَالِ الرُّسُلِ إِلَيْهِمْ فَيَقُولُوا مَا جَاءَنَا مِنْ بَشِيرٍ وَلَا نَذِيرٍ. وَقِيلَ: لَمْ أَكُنْ أُهْلِكُ الْقُرَى بِشِرْكِ مَنْ أَشْرَكَ مِنْهُمْ، فَهُوَ مِثْلُ" وَلا تَزِرُ وازِرَةٌ وِزْرَ أُخْرى [[راجع ج ٧ ص ١٥٧.]] ". وَلَوْ أَهْلَكَهُمْ قَبْلَ بَعْثَةِ الرُّسُلِ فَلَهُ أَنْ يَفْعَلَ مَا يُرِيدُ. وَقَدْ قَالَ عِيسَى:" إِنْ تُعَذِّبْهُمْ فَإِنَّهُمْ عِبادُكَ [[راجع ج ٦ ص ٣٧٧.]] " وَقَدْ تَقَدَّمَ [[راجع ج ١٦ ص ١٩٦.]]. وَأَجَازَ الْفَرَّاءُ أَنْ يَكُونَ "ذلِكَ" فِي مَوْضِعِ نَصْبٍ، الْمَعْنَى: فَعَلَ ذَلِكَ بِهِمْ، لِأَنَّهُ لَمْ يَكُنْ يهلك القرى بظلم.