“Maya is also a devotee of Krishna whose duty is to keep the criminals in jail. She never releases anyone unless they become a pure devotee of Krishna. But when someone becomes pure, she gladly accepts defeat, because her whole purpose is to help people surrender to Krishna. This is her success.
She expertly keeps the living entity in illusion until he understands that he is the eternal servant of Krishna, thus preventing the criminally minded living entities from creating havoc in the completely harmonious spiritual world. ”HH Jayapataka Swami
From the book: Vaianava Ke
Verse 11: Purport