That’s hardly a miracle. People ARE capable of memorizing any book if they so wished. Most religious Jews know the Tourah inside out; many religious Christians have memorized the Bible. This and including a million other Jewish traditions were copied later by Muslims. This was not a new practice.