Dhan Dhan Raja Janak Hai Jin Simran Keo Bibek
Ek Gharhi Ke Simraney Paapi Tharey Anek
Raja Janak is considered to be a great king of ancient times who was a very Dharmi(righteous) king.
Bhai Gurdas Ji has written about King Janak in his Vaars:
ਭਗਤੁ ਵਡਾ ਰਾਜਾ ਜਨਕੁ ਹੈ ਗੁਰਮੁਖਿ ਮਾਇਆ ਵਿਚਿ ਉਦਾਸੀ।
bhagath vaddaa raajaa janak hai guramukh maayaa vich oudhaasee
King Janak was a great saint who amidst maya remained indifferent to it.
ਦੇਵ ਲੋਕ ਨੋ ਚਲਿਆ ਗਣ ਗੰਧਰਬ ਸਭਾ ਸੁਖਵਾਸੀ।
dhaev lok no(n) chaliaa gan ga(n)dhharab sabhaa sukhavaasee
Along with gans and gandharvs (calestial musicians) he went to the abode of the gods.
ਜਮਪੁਰਿ ਗਇਆ ਪੁਕਾਰ ਸੁਣਿ ਵਿਲਲਾਵਨਿ ਜੀਅ ਨਰਕ ਨਿਵਾਸੀ।
jamapur gaeiaa pukaar sun vilalaavan jee narak nivaasee
From there, he, hearing the cries of inhabitants of hell, went to them.
ਧਰਮਰਾਇ ਨੋ ਆਖਿਓਨੁ ਸਭਨਾਂ ਦੀ ਕਰਿ ਬੰਦ ਖਲਾਸੀ।
dhharamaraae no aakhioun sabhanaa dhee kar ba(n)dh khalaasee
He asked the god of death, Dharamrai, to relieve all their suffering.
ਕਰੇ ਬੇਨਤੀ ਧਰਮਰਾਇ ਹਉ ਸੇਵਕ ਠਾਕੁਰੁ ਅਬਿਨਾਸੀ।
karae baenathee dhharamaraae ho saevak t(h)aakur abinaasee
Hearing this, the god of death told him he was a mere servant of the eternal Lord (and without His orders he could not liberate them).
ਗਹਿਣੇ ਧਰਿਅਨੁ ਏਕ ਨਾਉ ਪਾਪਾ ਨਾਲਿ ਕਰੈ ਨਿਰਜਾਸੀ।
gehinae dhharian eik naaou(n) paapaa(n) naal karai nirajaasee
Janak offered a part of his devotion and remembrance of the name of the Lord.
ਪਾਸੰਗਿ ਪਾਪੁ ਨ ਪੁਜਨੀ ਗੁਰਮੁਖਿ ਨਾਉ ਅਤੁਲ ਨ ਤੁਲਾਸੀ।
paasa(n)g paap n pujanee guramukh naaou(n) athul n thulaasee
All the sins of hell were found not equal even to the counterweight of balance.
ਨਰਕਹੁੰ ਛੁਟੇ ਜੀਅ ਜੰਤ ਕਟੀ ਗਲਹੁੰ ਸਿਲਕ ਜਮ ਫਾਸੀ।
narakahu(n) shhuttae jeeaa ja(n)th kattee galahu silak jamafaasee
In fact no balance can weigh the fruits of recitation and remembrance of the Lords name by the gurmukh.
ਮੁਕਤਿ ਜੁਗਤਿ ਨਾਵੈ ਦੀ ਦਾਸੀ ॥੫॥
mukath jugath naavai(n) kee dhaasee a
All the creatures got liberated from hell and the noose of death was cut. Liberation and the technique of attaining it are the servants of the name of the Lord.
After a long life of mediation and naam abhiyaas(meditation), King Janak gave up his body. A divine chariot descended and King Janak's soul boarded it. On the way the chariot came near to the abode of Dharam Raj, the lord of death. There, sinners were suffering punishment in millions of hells. When the wind that had touched the soul of King Janak came to them they felt great joy and their misery disappeared. Then those persons, oppressed by sins, wanting to keep King Janak's association, began to lament. They spoke piteously to King Janaka, "O blessed one. Please do not leave. We who are greatly tormented are feeling happy due to contact with the breezes that have touched your body."
Hearing their words, the very righteous king became filled with pity and thought to himself, "If due to the touch of the breezes that have touched my body I am bringing some happiness to the residents here, then I will stay in this place. This is heaven for me."
Thinking like this, the king stayed there by the gateway to hell. After some time, Dharam Raj himself came to that gateway. There he saw King Janak, full of mercy and a doer of great meritorious deeds, standing by the doorway.
Dharam Raj smiled and said to King Janaka, "O king! You are sarva-dharma-siromani - the crest jewel of piety. Why have you come here? This is a place for wicked sinners who cause harm to others. Men like you who perform meritorious deeds do not come to this place."
Dharam Raj then said, "Those persons who do not remember the Lord with their mind, words, or deeds I throw them into hell and punish them. Those who have remembered the Lord leave the sufferings of hell and quickly go to Heaven.
"O very intelligent king, my servants, unable to even look at persons like you, bring those who are great sinners. Therefore you should leave this place and go to lords abode.
Hearing the words of Dharamraj, with great compassion King Janaka replied, "O Dharam Raj, out of pity on these beings I shall not go to Heaven. Although situated in this place, they are feeling some comfort due to the breezes blowing past my body. If you release all of these persons living in hell then I shall be happy and will proceed to Heaven."
Hearing the words of King Janaka, Dharam Raj pointed out to him each of those living in hell and said told the king why they were in hell and the punishment each one of them was going to receive.
After making all of these persons eat the fruit of their sins, I shall release them. O best among men who have accumulated vast amounts of religious merit, please leave this place.
Having pointed out the sinful persons, Dharam Raj became quiet. With his eyes full of tears, King Janaka, the great devotee of the Lord, said, "Tell me, how can these miserable beings quickly be set free from hell and attain happiness?"
Dharam Raj replied, "These persons have never worshiped the Lord. How then can they be free from hell? O great king, if you desire to release them, even though they are great sinners, then give them the following religious merit possessed by you: Once, upon getting up in the morning, you meditated with a pure heart upon the Lord— the remover of great sins. Give them the religious merit which you obtained that morning when with a pure heart you uttered, "Rama, Rama." Obtaining that merit, they will get freedom from hell."
Hearing these words of the intelligent Dharam Raj, the great king Janak gave those persons the religious merit obtained by him from his birth. King Janak said, "Let these persons be released from hell due to the religious merit earned by me from birth by the worship of God."
As soon as he said this, those persons dwelling in hell immediately were freed from their suffering condition and obtained divine bodies. They said to King Janak, "O king, by your favour, in one moment we have been freed from miserable hell and will now go to the highest position."
All the sins of hell were found not equal even to the counterweight of balance. In fact no balance can weigh the fruits of recitation and remembrance of the Lords name by the gurmukh. All the creatures got liberated from hell and the noose of death was cut. Liberation and the technique of attaining it are the servants of the name of the Lord.
Seeing those now-effulgent persons freed from hell, King Janak, who desired the welfare of all beings, was very pleased in his mind. All those persons praised the great King Janak, the very treasure house of compassion, and went to the spiritual world.