It became necessary to compile the Quran because many of the memorizers of the Quran died in Riddah wars.