According to the Hindu mythology, lord Vishnu was impressed by the
might of Bali, grandson of the great devotee Prahalada (a great devotee
of Vishnu). Lord Vishnu was so pleased that he promised him divine
protection and immortality until Bali was crowned Indra. To keep his
promise, lord Vishnu left his abode in the heaven and started guarding
Bali. Alarmed at this, Goddess Lakshmi (the consort of Lord Vishnu)
decided to bring lord Vishnu back to his divine abode.
Goddess Lakshmi disguised herself as a Brahmin woman and went to Bali
to seek protection till her husband returns. Bali, kind by nature,
welcomed her (Lakshmi) into his palace. Lakshmi was in the lookout for
the right opportunity and came on the occasion of Shravana Purnima;
Lakshmi tied a colored cotton thread (Rakhi) on Bali's wrist. Bali was
greatly touched by this gesture of the Brahmin women (Lakshmi) and asked
her for a gift. Lakshmi grabbed this opportunity and revealed her real
identity and asked Bali to let go her husband (lord Vishnu). As Bali had
given his words, he had to relent but he extracted a promise from the
couple to visit his palace every year on this day for a meal with him.
Taking cue from this tradition sisters visit their brothers on the day
of Raksha Bandhan (Shravana Purnima) and have meal with them. On this
auspicious day, they tie a thread (Rakhi) on the wrist of their brothers
and wish for their long life and prosperity.
The legend of lord Vishnu is one of the oldest legends associated with the festival of Rakhi. It is an interesting part of the Raksha Bandhan story, origin and history.
Rakhi Festival : Rakhi Legends : Legend of Lord Vishnu