Story crows and the greatness of Shiva Panchakshari Mantra is found in the Shiva Purana. Long ago, the King of Kashi had a daughter named Kalavati. She was an ardent devotee of Shiva and received Shiva Panchakshari Mantra at a very young age.
Years later she married, Dasarha, King of Mathura. When he touched Kalavati he experienced unbearable heat.
Kalavati said that it was because of the sins committed by the king.
Therefore, she took King Dasraha to Sage Garga.
Sage Garga purified the sins of Dasarha by mantras. The he asked to king to stand in a river.
When the king stood in the river, sins came out of his body in the shape of crows. Many of them flew away and soon fell down with their wings burnt.
Sage Garga told the king that the crows were the volume of sins accumulated by the king during several births.
The king thus got purified of his sins and attained moksha.