The story goes back to the times when Lord Rama, Goddess Sita, Lakshman along with Lord Hanuman had returned from the exile of fourteen years. When they were leaving for exile from Ayodhya, Goddess Sita had taken a vow that she would pay a visit to the Saryu river and offer prayers at its bank, if they returned home safely. When they had finally reached home safely, Goddess Sita decided to visit the Saryu river.
She, along with Lakshman was going to the Saryu river. As Lord Hanuman saw them going, he wanted to accompany them but thinking that Goddess Sita might not give him permission, he started walking behind them just to accompany them secretly. As they reached the place, Lord Hanuman hid behind a tree near the river, so that they could not see him.
Preparing for the Puja, Goddess Sita asked Lakshman to get water from the river in a Kalash. Lord Hanuman was watching this from behind the tree. As Lakshman knelt down to fill the Kalash with water, he heard the scary laugh and saw a demon emerging from the river and approaching him.
As Lakshman stood and aimed at the demon, the demon proclaimed that he had a boon from Lord Shiva according to which no human being could kill him; hence, he would swallow Lakshman and fill his stomach. He was the demon Aghasura.
Goddess Sita, observing this from afar came running and using her divine powers swallowed Lakshman before the demon could do so. But to the surprise of Lord Hanuman, as the Goddess did that, she turned into a divine object that shone with a dim red light emitting from it.
Thinking that the demon might eat it as well, Lord Hanuman filled the ball-like object along with water in the Kalash and disappeared from there escaping from the demon.
Carrying the red round glim to Lord Rama, he narrated the entire story and requested him to make both of them alive again. Then Lord Rama said that Goddess Sita and Lakshman were not humans but also divine incarnations. Hence, he suggested him to go back and pour the water back into the same river. He further said that the river and other inhabitants also needed to be protected, so he should do that as soon as possible.
As per Lord Rama's orders, Lord Hanuman went and poured the water back into the river and the red glim soon spread into a huge ball of fire and thus burned the demon in it. Hence, the river was safe again and Goddess Sita and Lord Lakshman retook their original forms.