Why is the very first revelation in the 96th surah, and the last words in the 5th surah? Who decided to reâ€‘arrange the order of this Miraculous Book?
This is a long subject but I shall try to make it short. From time to time, Angel Gabriel (PBUH) visited Muhammad (SA), by Exalted Allah's leave, to reveal His words. Angel Gabriel (PBUH) would ask The Prophet (PBUT) to rehearse the Words carefully in the presence of his disciples. Each disciple was supposed to go over them at least one thousand times, and this went down to imams of mosques and others, each practising at least one thousand times. At the same time it was being recorded too. If there were any mistakes, misunderstandings or questions, they could go back in reverse order to check and correct. Once one group of revelations were well drilled throughout the community, or when there was a need for certain revelations, Angel Gabriel (PBUH) visited again, and the process was repeated.
Each year, Angel Gabriel (PBUH) reviewed all the revelations which had been revealed during the year for accuracy and correctness. In the last year, Angel Gabriel (PBUH) visited twice,  to make sure that everything was in perfect order. Incidentally, this gave Muhammad (SA), the clue that his life in this world was about to cease. But to answer the question, it was Allah the Exalted, Who, through Angel Gabriel (PBUH), placed the order of each singleayah to compile the Book. He clarified exactly where each ayah was supposed to be located in the Holy Qur'an. Therefore, not all ayat in a surahare in the sequence of revelation. Two sequential ayat might in the end be located in two separate surahs far from one another. This is the way Allah the Omnipotent wanted His Book to be, and this is the way It is. Recorded documents substantiate that the disciples of the rasul recorded everything according to the order given by the prophet without moving anything backward or forward.