Bhagavan Vyasa was the son of the great sage Parashara. He was the first person to write down the Vedas. Hence he is also known as Veda Vyasa.
Vyasa had a sharp brain and a mighty intellect. At one time he worked out the entire idea of Mahabharata in his head. He thought of writing it down. But the work was colossal. Who would write it for him? Finding no answer to his problem, he sat down to meditate. He meditated on Brahma, the creator of the Universe. When Brahma appeared before him, he said, "I have thought out the entire Mahabharata. But I cannot find anyone who would be equal to the task of writing it." Brahma answered, "Direct your prayers to Ganapati. Ask him to be your scribe (writer)." So Vyasa now meditated upon Ganapati.
We offer our worship to the Lord Ganesha. Who is Unborn. Absolute and Formless; who is beyond Bliss, and again Bliss itself. . . the One and the Infinite; who is Supreme without attributes, differentiation and desire; and who is verily the Supreme Brahman.
We offer our worship to the Lord Ganesha, who nature is beyond attributes; who is the embodiment of Intelligence and Bliss, the Effulgent Spirit, the All-pervading, the Goal of knowledge; who is the object of meditation to the sages. Formless and Omnipresent like space; and who is the Supreme Lord, the Supreme Brahman.
We offer our worship to the Lord Ganesha, who is the Cause of the world, the Primal Knowledge, the Origin of Gods, the Source of Bliss, the Lord ofGunas, the Lord of heavenly hosts; who pervades the universe.
Gods and who is verily the Supreme Brahman.
When He appeared before him, Vyasa said, "I want you to be my scribe. I want you to write down the Mahabharata at my dictation. Please answer my prayers."
Ganapati smiled and said, "Most gladly I will be your scribe. But on one condition. At no point must my pen stop writing. Your dictation should be continuous."
This was a little tough, indeed. So Vyasa, after a moment's thought, said, "All right. I agree to your condition. But I, too, have a condition to make—that you will not write down anything unless you understand its meaning fully."
Ganapati agreed to this.
In between, Vyasa needed time to think out his stanzas clearly. He needed time for bath, prayers, food and a little nap. So he would clearly compose a few difficult stanzas and dictate them. Lord Ganesha, to fulfill his part of the bargain, had to pause and work out its meaning. Meanwhile Vyasa would get the next set of verses ready in his mind! or, will return back after his food and rest!
Thus was the great and holy book, Mahabharata completed – written down by Lord Ganapati and dictated by the poet sage Vyas.