Yahya said: And they narrated to us that the surahs were not revealed all at once, except for a few of them; rather, the Prophet (peace and blessings be upon him) had already named the surahs. Whenever something of the Quran was revealed, he would order that they place it within the surah in the location he commanded them, until the surahs were completed. He used to command that some of the Medinan revelations be placed in some of the Meccan surahs, and that some of the Meccan revelations be placed in some of the Medinan surahs. Gabriel (peace be upon him) would come to the Prophet (peace and blessings be upon him) and say: 'Allah, Blessed and Exalted is He, commands you to place such-and-such verse amidst such-and-such, and such-and-such (between such-and-such) of the surah.'
Although the Meccan was revealed before the Medinan, this arrangement which is between the surahs was not revealed in this specific order. Rather, it was placed in this way; the Meccan surahs were not gathered separately, one following the other in the arrangement of the surahs, nor were the Medinan surahs gathered separately, one following the other in the arrangement of the surahs.
Some of what was revealed in Mecca was commanded for when they would be in Medina, to be acted upon when they arrived in Medina. Some of the verses were revealed after others, yet in the arrangement, they appear afterwards. We have explained these aspects in their appropriate places in the exegesis. Whatever was revealed in Mecca, and whatever was revealed on the way to Medina before the Prophet (peace and blessings be upon him) reached Medina, is from the Meccan, and whatever was revealed to the Prophet (peace and blessings be upon him) during his travels after he arrived in Medina is from the Medinan, and what was (3b)... and most of it is Meccan.