There are records in Hindu sacred literature, the Puranas and the Mahabharata, of the practice of the tying of a rakhi by a sister on her brother, but there is no clear account of its origin. Several legends are thought to mark the origins of the festival,or have contributed to its popularity. It is said that after her rescue from Ravana, Sita tied a rakhi on the wrist of Lakshmana to invoke his protection from future dangers.
Also, after Lord Krishna slew Shishupal, Krishna was left with a bleeding finger. Draupadi, who considered Krishna as a brother tore a strip of silk off her sari and tied it around Krishna’s wrist to stop the flow of blood. Touched by her concern, Krishna had declared himself bound to her by her love. He further promised to repay the debt manifold, and spent the next 25 years of his life doing just that. For all that Draupadi was the daughter of a powerful monarch, sister to a legendary warrior, and wife to five warrior princes, Krishna remained the one that she truly relied upon.
According to another legend, Raksha Bandhan was a ritual followed by Lord Yama (the Lord of Death) and his sister Yamuna. Yamuna tied rakhi to Yama. Yama was so moved by the serenity of the occasion that he declared that whoever gets a rakhi tied from his sister and promised her protection would be protected from death.