Yama was one of the earlier Indian gods. As the death god of the Vedas, he was one of the Lokapalas, or Guardian of the Universe. He was the Lokpala of southern quarter. In the Vedic period he was the lord of the dead and Guardian of the World of the Fathers, where he blessed the dead.
At the approach of the medieval period , his role began to get somewhat altered for he was no longer the cheerful lord of paradise, but the stern judge of the dead, ruling over the purgatories where the wicked suffered until their rebirth. The idea of a divine judge, theoretically unnecessary according to the doctrine of karma, may have been imported from the west, where it was known in many cults.
Sometimes Yama, aided by his clerk Chitragupta, is described as weighing the deeds of the souls of the dead in a balance, rather like the Egyptian Throth.