Samvartta, Brihaspati's brother, once conducted a Maheshwara yagna on behalf of a king called Marutha. Since Brihaspati is the Guru of the Gods, many Gods were also present and Ravana showed up at the yagna challenging Marutha in his wish to conquer the three worlds, after receiving a boon from Brahma that made him invincible against the Gods.

Terrified at seeing him there, the Gods hid and took up the form of various animals/birds as a disguise.

Indra became a peacock, Kubera a lizard, Varuna a swam and Yama assumed the form of a crow and so did several others.

Angry at seeing the yagna being conducted, Ravana killed and even devoured the sages present and after he left the Gods assumed their original form and were very grateful to the animal forms that had saved them. In return, they each gave a boon to the respective species of animal they had turned into.

Yama (the God of Death), gave the crow a boon that it will enjoy immunity from the various ailments to which the birds are subject. Also he blessed that the fear of death shall not approach them and they shall exist as long as people do not slay them.

And finally, He said, that those residing in his dominion (i.e those who are dead) when hungry will be refreshed when the crow had eaten and been refreshed.

This is why, whenever the crows have eaten and been replenished, the Pitris (spirits of departed ancestors) will also be replenished.