Long long ago, Sage Ved Vyasa had written the Purans to
explain the meaning of Vedas to the common people.
One day, he sat thinking what to write next. Just then, Sage Narada
came to him with a suggestion. He said, "You should write about the
glory of Narayana to inspire bhakti (devotion) in people. It is because
of bhakti towards Narayana that I am his attendant. In my previous birth
I was an angel in heaven. Once Dakshabarma was performing a yajna. Since,
I was not paying attention to the mantras, he cursed me to be born as the
son of a servant in an ashram. In the company of the sages of the ashram, I developed devotion to god. I went to meditate in the forest. After
many years, Narayana appeared before me and promised to make his
attendant in my next life."
Inspired by Sage Narada's story, Ved Vyasa wrote the Mahabharata.