When Vishwamitra was a king, he once visited Vashishtha's ashram with a large entourage. Yet, they were all provided with lavish hospitality in a short time. King Vishwamitra was astonished at how Vashishtha managed this and questioned him about the secret behind it. Vashishtha pointed to a sacred cow named Sabala, the daughter of the great cow Kamadhenu, who had the power to fulfill any desire.
The king wanted Sabala for himself, but Vashishtha, unmoved by any persuasion or intimidation, refused to part with his beloved cow. Enraged, King Vishwamitra ordered his soldiers to seize Sabala. In response, she pleaded with Vashishtha for help. Vashishtha advised her to summon more soldiers than Vishwamitra had. Sabala did so, and ultimately, Vishwamitra's forces were defeated.
After all his attempts failed, Vishwamitra turned to Vashishtha, seeking the secret of his power.
"My abilities arise from within," Vashishtha replied. "They are the result of my meditation and unwavering adherence to discipline."
Reflecting on his defeat, Vishwamitra thought, Despite being a mighty king, I was overcome by a forest-dwelling sage. I, too, must attain such great power. Determined, he instructed his son to oversee the administration of his kingdom. Then, he relinquished all his wealth and luxuries and retreated to the forest. To earn the grace of Lord Shiva, he practiced intense penance and other forms of divine worship with fervent devotion. When Shiva appeared before him, Vishwamitra requested powers akin to Vashishtha’s, particularly the invincible Brahmastra, to ensure his victory. Shiva granted his wishes.
Soon after, Vishwamitra launched an attack on Vashishtha. Yet, Vashishtha, calm and untroubled, stationed his disciples at the entrance of his ashram and withdrew to meditate. With steadfast resolve, the students managed to block and neutralize all of Vishwamitra’s weapons, including the formidable Brahmastra.
“What is the worth of being a Kshatriya if I can be defeated by a sage?” mused Vishwamitra. “I, too, must become a Brahmarshi like Vashishtha.” With this resolve, Vishwamitra dedicated himself to performing yagyas and Vedic rituals with heightened zeal. Despite years of dedication, he achieved the status of Rajarshi, yet the title of Brahmarshi eluded him.