In Tulasidas's Shree Ramcharitmanas, Lord Shiva tells Parvatiji that the Supreme Lord takes the avatar and descends to Earth for various reasons. One cannot pinpoint and say that the Lord takes avatar "only for this" reason.
सुनु गिरिजा हरिचरित सुहाए । बिपुल बिसद निगमागम गाए ।।
हरि अवतार हेतु जेहि होई । इदमित्थं कहि जाइ न सोई ।।
sunu girijā haricarita suhā'e. bipula bisada nigamāgama gā'e
hari avatāra hetu jehi ho'ī. idamitthaṁ kahi jā'i na so'ī
"O Parvati! Listen, the Vedas and scriptures have sung the beautiful, detailed, and pure characters of Sri Hari. The reason for which Hari takes avatar cannot be said as ‘this is it’ because there can be many reasons which one’s material intellect cannot even comprehend."
The fundamental reason for Lord's avatar is to establish dharma by defeating rakshas, spreading God's glory, and giving bliss to the devotees. Lord Shiva then narrates different avatar stories of Lord Ram and Ravan in different kalpas. Here, we are listing those stories.
The Cycle of Curse and Redemption: Jay and Vijay's Journey from Vaikuntha to Earth
Once, the Sanatkumaras had the privilege of visiting Lord Vishnu in his abode in Vaikuntha. However, two guards of the Lord, who go by the names of Jay and Vijay, blocked their path. A misunderstanding ensued, and ultimately, the Kumaras decided to curse Jay and Vijay to be born as demons on Earth for three lifetimes. This curse saw the duo take the form of Hiranyaksha and Hiranyakashipu, creating chaos and destruction during their time on Earth. To restore peace, Lord Vishnu had to take on the avatars of Varah and Narsimha to vanquish the demons. However, Jay and Vijay were not done yet, and they returned to the mortal world as Ravan and Kumbhakarna. This time, Lord Ram had to intervene and defeat the duo.
The Tale of Sage Narad's Curse and the Birth of Ravan and Kumbhakarna
Once, sage Narad went to the Himalayas to perform Tapasya. As usual, Indra believed that Narad was doing Tapasya to claim his throne, so he sent Kamdev to break his penance. However, Narad's Tapasya was so strong that Kamdev failed to break it. Narad's ego inflated after defeating Kamdev, and he went around boasting about it to Lord Shiva and Lord Vishnu. To teach Narad a lesson about pride, Lord Vishnu created a grandiose town where the king, Sheelnidhi, organised a Swayamvar for his beautiful daughter, Vishwa Mohini. Narad fell in love with her at first sight but lacked confidence in his appearance. He went to Lord Vishnu and asked him to make him as beautiful as Hari. Instead of giving him a beautiful face, Lord Vishnu gave him a monkey's face. Narad was unaware of this and went to the Swayamvar, where everyone mocked him, including two Shiv Ganas disguised as brahmins. They teased Narad the most, and as a result, Narad cursed them to be born as demons. Narad was so humiliated that he cursed Lord Vishnu that he would also bear the pang of separation from his beloved wife. To fulfil Narad's curse, Lord Vishnu took the avatar of Lord Ram, and the two Shiv Ganas became Ravan and Kumbhakarna.
Jalandhar as Ravan
In one Kalpa, the demon Jalandhar, who Lord Shiva killed, took rebirth as Ravan.
The reincarnation of King Pratapbhanu and the Birth of Ravan
Long ago, there lived a virtuous King named Pratapbhanu who, with the help of his younger brother Ripumardan and the minister Dhramruchi, defeated all his enemy kings and performed thousands of yajnas. One day, while chasing a wild boar, he encountered a supposed sage, one of Pratprudra's enemies. The unsuspecting king was so impressed by the imposter that he agreed to a devious plan suggested by him. The fake sage proposed that Pratapbhanu organise a year-long feast for brahmanas in his palace. This would satisfy the brahmanas, and Pratabhanu would become the undefeated king of the entire planet for thousands of years. However, with the help of a demon named Kalketu, the imposter hatched a plot to trick the brahmanas into eating impure food and make Pratpbhanu responsible for it so that they would curse him.
Unfortunately, the plot succeeded, and the Brahmans cursed the innocent king Pratapbhanu and his entire family and ministers to be reborn as demons. As a result, the king became Ravan, his younger brother became Kumbhakarna, and the minister Dhramaruchi became Vibhishan. Lord Ram took avatar and defeated them to rescue them from their demonic life.
The Divine Boon to Manu and Satrupa and reincarnation as Lord Ram's Parents
Manu and Satrupa, a devoted couple, underwent Tapasya (penance) with the desire to have a glimpse of the Supreme Lord in his Ram form. After years of dedicated penance, Lord Ram and Mother Sita manifested before them and granted them a boon. Manu and Satrupa wished for a son who would resemble Lord Ram. The Lord replied that no one in the universe was precisely like him, but he would take birth as their son and bless them with the honour and happiness of being the parents of the Supreme God. Therefore, Manu and Satrupa were reborn as king Dashrath and Kaushalya, respectively, and Lord Ram took birth as their son during the treta-yuga.
देखि प्रीति सुनि बचन अमोले । एवमस्तु करुनानिधि बोले ।।
आपु सरिस खोजौं कहँ जाई । नृप तव तनय होब मैं आई ।।
dekhi prīti suni bacana amole. evamastu karunānidhi bole.
āpu sarisa khojau kahaṁ jā'ī. nṛpa tava tanaya hoba mai ā'ī.
"Seeing the king’s love and hearing his invaluable words, the Karunanidhan Bhagavan said – so be it. O, king! Where can I go to find [another] like myself? Therefore I myself will come and become your son."