Story related to Dhammapada Verse 21-23: Samavati and Māgaṇḍiyā
While residing at the Ghosita monastery near Kosambi, the Buddha uttered Verses 21-23, with reference to Samavati, one of the chief queens of Udena, King of Kosambi.
Samavati had a maid servant called Khujjuttara. The maid had to buy flowers for Samavati from the florist Sumana everyday. On one occasion, Khujjuttara had the opportunity to listen to a religious discourse delivered by the Buddha and she attained Sotapatti Fruition (first stage of enlightenment). She repeated the discourse of the Buddha to Samavati and the 500 maids-of-honour, and they also attained Sotapatti Fruition. From that day, Khujjuttara did not have to do any menial work, but took the place of mother and teacher to Samavati. She listened to the discourses of the Buddha and repeated them to Samavati and her maids. In course of time, Khujjuttara mastered the Tipitaka.
Samavati and her maids wished to see the Buddha and pay obeisance to him but they were afraid the king might be displeased. So, they made holes in the walls of their palace and looked through them to pay homage to the Buddha everyday.
At that time, King Udena had also another chief queen by the name of Magandiya. She was the daughter of a brahmin. The brahmin thought the Buddha was the only person who was worthy of his very beautiful daughter. So, he hurriedly went off to fetch his wife and daughter and offered to give his daughter in marriage to the Buddha. Turning down his offer, the Buddha said, "Even after seeing Tanha (craving), Arati (aversion) and Raga (lust), the daughters of Mara, I felt no desire in me for sensual pleasures; after all, what is this which is full of urine and filth and which I don't like to touch even with my foot."
On hearing those words of the Buddha, both the brahmin and his wife attained Anagami Magga and Phala (third stage of enlightenment). They entrusted their daughter in the care of her uncle and they themselves joined the Order. Eventually, they attained arahatship. However, the daughter Magandiya became very bitter and sore. She vowed to take revenge when an opportunity arose.
Later, her uncle presented Magandiya to King Udena and she became one of his chief queens. Magandiya came to learn about the arrival of the Buddha in Kosambi so, she planned to take her revenge on the Buddha and to harm Samavati and her maids who were ardent devotees of the Buddha. Magandiya told the king that Samavati and her maids had made holes in the walls of their living quarters, they were making contacts outside and were disloyal to the king. King Udena knew the truth behind the holes and wasn't angry with Samavati.
Magandiya wanted the King to believe that Samavati wanted to harm and kill him so she planted a snake when the King visited Samavati. When the king saw the snake he believed Magandiya's words that Samavati was trying to kill him. The king was furious. He commanded Samavati to stand and all her ladies to line up behind her, he tried to shoot them with arrows dipped with poison. As Samavati and her ladies bore no ill wills towards the king and through the power of goodwill (metta), the arrow turned back. Then, the king realized the innocence of Samavati and he gave her permission to invite the Buddha and his disciples to the palace for alms-food and for delivering discourses.
Magandiya realizing her plans had failed, she made a final infallible plan. She sent a message to her uncle with full instructions to go to Samavati's place and burn down the building with all the women inside. As the house was burning, Samavati and her maids-of-honour kept on meditating. Thus, some of them attained Sakadagami Fruition (second stage of enlightenment), and the rest attained Anagami Fruition (third stage of enlightenement).
The king rushed to the scene, but it was too late to save them. He suspected that it was done at the instigation of Magandiya. He said on purpose "While Samavati was alive I had been fearful of beiong harmed by her but now she's gone i will be at peace. Who could have done this? It must have been done only by someone who loves me very dearly." Hearing this, Magandiya promptly admitted that it was she who had instructed her uncle to do it. The king pretended to be very pleased and asked her to invite her relatives here to be honored. On arrival at the palace, all of them, including Magandiya, were seized and burnt in the palace court yard, by the order of the king.
When the Buddha was told about these two incidents, he said that those who are mindful do not die; but those who are negligent are as good as dead even while living.
In other words, the heedful , diligent and wise ones will practice and strive on to achieve nibbana. whereas those who are heedless, not mindful will not attain and live as if like the dead.