Prophets were sent after people started to differ after being upon the truth
There were ten qarn (generations) between Nūḥ and Ādam. They were all upon the True Shariʿah then they differed ˹thereafter.˺ Then Allah sent Prophets to give glad tidings and warnings. ˹Ibn ʿAbbās˺ said: this is how it is in the recitation of ʿAbdullāh ˹b. Masʿūd˺: "The people were all one ummah (nation) and they then differed..."
«كَانَ بَيْنَ نُوحٍ وَآدَمَ عَشَرَةُ قُرُونٍ كُلُّهُمْ عَلَى شَرِيعَةٍ مِنَ الْحَقِّ فَاخْتَلَفُوا فَبَعَثَ اللَّهُ النَّبِيِّينَ مُبَشِّرِينَ وَمُنْذِرِينَ» قَالَ وَكَذَلِكَ فِي قِرَاءَةِ عَبْدِ اللَّهِ «كَانَ النَّاسُ أُمَّةً وَاحِدَةً فَاخْتَلَفُوا»