(And We created not the heaven and the earth and all that is between them without purpose! That is the consideration of those who disbelieve! Then woe to those who disbelieve from the Fire!) (38:27)
مَا خَلَقْنَاهُمَا إِلَّا بِالْحَقِّ وَلَـٰكِنَّ أَكْثَرَهُمْ لَا يَعْلَمُونَ "We did not create them but with true purpose, yet most of them do not know. (44:39) " In other words, every wise and thinking person should realise that there is a purpose and objective for creating this universe. The heavens and the earth and everything created in them manifest many realities. Examples are: (1) the manifestation of Divine power; (2) the possibility of the Hereafter. Obviously, the Supreme Creator Who drew out such huge bodies from the realm of non-existence into the realm of existence surely has the power to destroy them and re-create them; (3) the need for retribution (reward/punishment). If there is no retribution in the Hereafter, the very existence of the universe would be rendered purposeless or its purpose would be defeated. The wisdom underlying the creation of the universe is to make it dar-ul-imtihan (the domain of test-n-trial) and the Hereafter is the domain of reward and punishment. Otherwise, the outcome of both good and bad will necessarily be the same. This is far from Divine wisdom, or not in keeping with Divine wisdom; and (4) urging the thinking people to obey Allah and thank Him for having granted man this entire universe or creation as His great blessing
Tazkirul Quran
Maulana Wahiduddin KhanOn ayahs 37–41
In every period the root cause of a man’s going astray has been his loss of belief in the life after death. The disbelief of some finds expression in their utterances. Others may not openly express it, but their hearts are devoid of the belief that they have to rise after death and face the reckoning of their deeds before God. The reason for this misunderstanding is generally that man, in view of his strong position in this world, presumes that he is never going to lose his elevated status, though the history of past nations ought to be enough to dispel this illusion. Tubba‘ was the title of the Kings of the ancient Himyar tribe of Yemen. These people enjoyed prominence from 300 B.C. to 115 B.C. and their greatness was much talked about in ancient Arabia. The rise and fall of the Tubba‘ people, a piece of history well-known to the initial addressees of the Quran (the Quraysh), gave proof of the fact that the law of ‘crime and punishment’ was prevalent in this world. Similarly, for every community there is a ‘Tubba‘’ which, by its example, teaches them a lesson. But, man is wont to take such occurrences as being nothing out of the ordinary. The result is that he does not learn those lessons which, by God’s will, are latent in events.
Uthmani text of the Madinah mushaf (King Fahd Complex). Translation: Saheeh International. Tafsir via Quran.com.