Disclaimer: This translation does not guarantee complete accuracy, please confirm with the original page text.
Agam Sutra 39, Chhed Sutra-5, 'Mahanishith'
The text explains that the karma has arisen due to the Maya (illusion) that the being had in other births.
O Bhagvant! How did that great being perform Maya in other births, which led to such terrible karma? O Gautam! The soul of that Gachchadhipa was born as the daughter of a common king, millions of births ago. Once, after her marriage, her husband died immediately. Then her father told the princess, "O Bhadra! I give you fifty kingdoms from my village. From its income, give food, water, clothes, as much wealth, grain, gold, silver, or all kinds of happiness to the blind, the half-bodied, the disabled who cannot walk, those suffering from severe diseases, those defeated by everyone, the poor, the sorrowful, those stained by bodily impurities, those born poor, the Shramanas, the Shravakas, the restless, the relatives, and anyone who desires it. Give them complete compassion and protection. This will prevent you from becoming the cause of unpleasantness and defeat for all beings in future births. And do not become a barren, widowed, unhappy woman, devoid of the means of enjoyment and consumption, such as good fragrance, flower garlands, betel nut, ointments, body adornments, etc., with incomplete desires and a sorrowful birth."
Then, O Gautam! She accepted it with humility. But her cheeks were washed with tears flowing from her eyes, and she said in a hollow voice, "I don't know how to speak much. Go from here and quickly make a large wooden pyre so that I can immerse my body in it. I, a sinner, have no purpose in living now. Perhaps, subject to the fruition of karma, I will become a stain on your lineage, which is renowned throughout the world for its extraordinary name, its fame, and its pure glory, due to the fickle nature of a great sinner like me. My actions might defile your entire lineage." After that, the king thought, "Indeed, I am fortunate to have such a jewel-like daughter, even though I am childless. Oh! The wisdom of this girl! Oh! Her intelligence! Oh! Her knowledge! Oh! Her detachment! Oh! Her form that will stain our lineage! Oh! This girl is worthy of worship every moment, with such great qualities. As long as she remains in my house, my great welfare will be ensured. Seeing her, remembering her, and speaking with her will purify the soul. So, this daughter is like a son to me, who is childless." Thinking this, the king said, "O daughter! According to the customs of our lineage, there is no burning of a widow on a pyre. So, you should follow the path of virtue and the Shravaka dharma, give charity, perform austerities and fasts as you wish, and especially engage in acts of compassion for living beings. This kingdom is also yours." Then, O Gautam! After her father said this, she remained silent, stopping from jumping into the pyre. Then, the father entrusted her to the guards and servants of the inner palace. As time passed, the king died. A wise and great minister, gathering together, decided to crown this princess. Then, she was crowned. O Gautam! After that, she sat in the assembly hall every day.
Now, one day, in that royal assembly, filled with hundreds of men, including wise men, students, Bhattas, Tadingas, Musaddis, clever, discerning, ministers, and Mahants, the princess, subject to the fruition of karma, sitting on the royal throne, saw a handsome young man with beautiful features, radiance, and wealth, with eyes full of desire and passion.
The young man understood her inner feelings. He thought, "This poor princess has fallen into a dark and endless abyss of sorrow because of seeing me. Indeed, I am unfortunate that my body, a machine for generating such desire, a collection of particles, makes me jump into the fire of lust like a moth. What should I do now? I will quickly abandon this sinful body. I will perform severe penance for this.
I will embrace the Aṇagāra dharma, which destroys all sins, just as it abandons all possessions."
Muni Diparatnasagar Krit (Mahanishith) Agam Sutra - Hindi Translation
Page 140