Yama, god of death in Hinduism, appeared as Vidura on earth and was the uncle of Kauravas and Pandavas in Mahabharata. The birth of Yama on earth as Vidura was a result of curse by Sage Mandavya. Legend has it that once Sage Mandavya was in deep meditation in his ashram. A group of thieves who were being chased by soldiers ran into the ashram and hid inside it.
Sage Mandavya was immersed in his meditation and was unaware of what was happening around him. The soldiers caught the thieves from the ashram and accused the sage of assisting the thieves.
The soldiers in a fit of rage thrust a spear into the sage which resulted in his death.
When Sage Mandavya wanted to know from Yama why he had suffered such a fate; Yama explained that as a child the sage used to catch butterflies and enter sharp twigs through them for fun.
Sage Mandavya felt that the actions of children, which are done in innocence, should be forgiven and should not be part of Yama’s book – the book which keeps track of all activities of human beings.
Sage then cursed Yama to take birth of earth in the womb of woman who will be a Dasi (servant) and mistress of king. Thus Vidura was born as the son of Sage Vyasa and a dasi – who was the mistress in the palace of the Kurus in Hastinapura.
Vichitravirya, the last of the prince of Kuru clan, died without children. Satyavati then asked Bhishma to marry the two wives of Vichitravirya – Ambika and Ambalika. He declined as he had promised to remain a Brahmachari. Then Satyavati summoned Sage Vyasa, her son, to father her grandchildren.
The two wives of Vichitravirya found Sage Vyasa to be ugly. Ambika closed her eyes during copulation. She thus gave birth to blind Dhritarashtra. Ambalika too was repulsive during the act and she gave birth to pandu, who had lack of color in skin. When two deformed child were born in the clan, Satyavati asked the queens to copulate again. But the queens were not interested and instead sent a dasi to the room of Sage Vyasa. They had a natural copulation and Vidura was born to them.
But as Vidura was born of a Dasi he was denied the crown of Hastinapura.