قُلْ أَنزَلَهُ ٱلَّذِى يَعْلَمُ ٱلسِّرَّ فِى ٱلسَّمَـٰوَٰتِ وَٱلْأَرْضِ ۚ إِنَّهُۥ كَانَ غَفُورًا رَّحِيمًا Qur’an Al-Furqan (25:6)Qul anzalahu allathee yaAAlamu alssirra fee alssamawati waalardi innahu kana ghafooran raheeman
He forgives those who repent, and gives a grace period to those who do not.
The answer is that the Qur-an teaches spiritual knowledge of what is ordinarily hidden from men's sight, and such knowledge can only come from Allah, to Whom alone is known the secret of the whole Creation. In spite of man's sin and shortcomings, He forgives, and He sends His most precious gift, i.e., the revelation of His Will.