There are times when we have to use cunning for the sake of good. In such circumstances, the end always stands higher than the means. Such means are especially important in statecraft and warfare.
This took place much before the times of the Pandavas and the Kauravas. The Devas (gods) and their cousins the Daityas (demons) were at war. The Daityas were winning the war because their preceptor, the venerable Shukracharya, knew the Sanjeevani mantra that could revive the dead. The Devas thought and concluded that there was no way that they could meet the challenges of the Daityas unless they had knowledge of the Sanjeevani mantra. They chose Kacha, the son of Brihaspati their preceptor, to do the needed.
Kacha went to Shukracharya and begged of him to be his teacher. Giving due respect to Brihaspati and also taken in by Kacha’s humble behaviour, Shukracharya readily accepted Kacha’s request. Kacha fulfilled his obligations as a pupil much to the liking of Shukracharya and, also, in time grew close to Shukracharya’s daughter, Devayani.
The guileful Daityas came to suspect Kacha’s intentions and decided to kill him without Shukracharya’s knowledge. One day they caught hold of him immersed him in the sea and brought him dead to Shukracharya citing some lame reason for his death. Shukracharya however could see through their wicked act and using the Sanjeevani, brought Kacha back to life.
The second time, the Daityas tore up Kacha and fed his flesh to dogs. Devayani tearfully reported to Shukracharya of this and he once again uttered the Sanjeevani and Kacha came back to life tearing open the dogs.
The Daityas, a third time, killed Kacha by tying him to a tree and burning him. They then mixed his ashes with some wine and gave it to Shukracharya to drink. Only after he drank it did Shukracharya come to know of the act perpetrated by the Daityas. Instantly, he could see through the ploy of the Devas!
He taught the Sanjeevani to Kacha who was inside him and then, lying down recited the mantra. Kacha came out tearing Shukracharya’s body. True to his nature, Kacha brought Shukracharya back to life.
Since then, by Shukracharya’s curse, any person who partakes of wine will face misery just as he did himself. Kacha returned to the realm of the gods with knowledge of the Sanjeevani. As for Devayani, Kacha had come out of Shukracharya’s body and had thereby become her own blood and brother; so she could not marry him! She later married a king named Yayati who was an ancestor to the Pandavas and the Kauravas.