And We said thereafter to the Children of Israel, “Dwell securely in the land (of promise)”: but when the second of the warnings came to pass, We gathered you together in a mingled crowd.
This part of the story of Pharaoh has been related here because it applied exactly to the mushriks of Makkah who were doing their best to uproot the Prophet (peace be upon him) and the believers from the land of Arabia. This story, so to say, tells them:Pharaoh resolved to uproot Moses (peace be upon him) and the Israelites but was himself completely annihilated along with his followers. But Moses (peace be upon him) and his followers settled down in the land. Likewise, if you persist on the same way, you will surely meet with the same end.
Maududi, Abul Ala (2010). Tafhim ul Quran. https://www.englishtafsir.com/Quran/27/index.html