[The angels said], "O Abraham, give up this [plea]. Indeed, the command of your Lord has come, and indeed, there will reach them a punishment that cannot be repelled."
Allah, the Exalted, informs of what happened after the fright of Ibrahim left him and he felt no more fear of the angels when they refused to eat. After this, they gave him the glad tidings of the birth of a son and the destruction of the people of Lut. When they told him of this, he spoke to them as Sa`id bin Jubayr narrated concerning this verse. Sa`id said: When Jibril and the other angels who were with him came to Ibrahim, they said,
إِنَّا مُهْلِكُو أَهْلِ هَـذِهِ الْقَرْيَةِ
(Verily, we are going to destroy the people of this town.) Ibrahim said to them, "Will you destroy a town that has three hundred believers in it" They said, "No." He then said, "Will you destroy a town that has two hundred believers in it" They said, "No." He said, "Will you destroy a town that has forty believers in it" They said, "No." He then said, "Thirty" They still replied, "No." This continued until he said, "Five" They said, "No." Then he said, "What do you think if there is one Muslim man in the town, would you destroy it" They said, "No." With this, Ibrahim said,
Surah Hud (علیہ السلام) carries an account of different kinds of Divine punishments sent over past peoples because of their antagonism to prophets of the time. Described in the verses cited above is the moral condition of the people of Sayyidna Lut (علیہ السلام) and the severe punishment given to them.
Besides being disbelievers, the people of Sayyidna Lut (علیہ السلام) were involved in the practice of such abject evil and immodesty as was not found in the world before them, something even wild animals hate. That a man would pollute his honor and dignity with another man is a curse the fallout from which is far more injurious than common forni-cation. Therefore, the harsh punishment that descended on these people had never hit known practitioners of common acts of immodesty.
Abraham’s conversation took place with those angels who had come to destroy Lot’s community. These angels had come to carry out God’s orders, and God made it clear that they came at His behest. A part of this conversation between the Prophet Abraham and the angels is given in chapter 29 (verse 32) and a detailed account of this also appears in the Bible (Genesis, chapter 18). Abraham’s prayer in favour of Lot’s community being spared was not accepted. Similarly, Noah’s earlier prayer that his son be spared had not been accepted. Prayer amounts to presenting oneself before God. If Noah’s son or Lot’s community had had the urge to pray, and had they prayed to God to be given respite, then God would certainly have pardoned them and would have sent them His blessing. Revoking of punishment is possible, as we find from the example of the community of Jonah (Yunus). But if the punisment is revoked, it will be done on the strength of the prayers of the persons who have to suffer punishment, and not in answer to the prayer of any other person, even if that other person be a prophet. The reason for this is that a prayer for pardon is not a recommendation, in the usual sense, which one person makes in favour of another person and which, due to the holiness of the former, is accepted in favour of the latter. One person should certainly pray for another; in every period, prophets and righteous people have prayed for others. But this is, in fact, an expression of the forbearance, kind-heartedness and the inclination towards God of the person who prays. A servant of God has fear of God at heart, starts trembling when he sees God’s punishment, and starts praying for himself and for others. However, prayer by others will be effective only when the affected person himself fears God and invokes His grace.
Uthmani text of the Madinah mushaf (King Fahd Complex). Translation: Saheeh International. Tafsir via Quran.com.