The story of Raksha Bandhan mentioned in Bhavishya Purana which refers to a Sura-Asur Yudh (war between Gods and demons). King Brutra, the powerful demon king, was attacking the Gods army with a furious approach and the Gods were on the edge of defeat.
Worried King, Indra, approached Guru Brihaspati, Guru of Gods, with a hope of finding a solution to stop the demon Brutra. Brihaspati advised Indra to get a sacred thread tied on his wrist on Shravan Purnima day. Sachi Devi, also known as Indrani, Lord Indras wife, sanctified a thread and tied on to his hand on Shravan Pournami. The sacred thread powered the Gods not only to get rid of the defeat but routed to a great victory for them.
Thus the sacred thread, also referred as Raksha, protected the Devas. Since then, every year on Shravan Purnima, Raksha Bandhan or Rakhi festival is celebrated.