فَجَعَلْنَاهَا نَكَالًا لِّمَا بَيْنَ يَدَيْهَا وَمَا خَلْفَهَا وَمَوْعِظَةً لِّلْمُتَّقِينَ
Faja'alnaahaa nakaalal limaa bayna yadayhaa wa maa khalfahaa wa maw'izatal lilmuttaqeen
And we made it a warning to those of that time and to those who came after, and a lesson for the God-conscious.
Nakāl names a punishment made exemplary, from a root for a shackle or restraint, so its purpose is what it prevents in others. Commentators split over whether those before it and those after mean the generations on either side or the towns surrounding. The lesson at the end is directed to the God-conscious, which sends the warning outward rather than leaving it with the offenders.