The god Krishna, who is a close friend of and advisor to the Pandavas, hears of Duryodhana's plan, and devises one of his own, to ensure that Aravan will give himself as a sacrifice on behalf of the Pandavas rather than the Kauravas.
Later Tamil sources provide variants to Peruntevanar's version.