When he suppresses the the wicked by punishing them severely and favours the righteous by giving them rewards, he is then said to put on the form of Yama.
यदा त्वधार्मिकान् सर्वांस्तीक्ष्णैर्दण्डैनियच्छति। धार्मिकांश्चानुगृह्णाति भवत्यथ यमस्तदा॥