The Story
The Ekadashi fast itself is old: the Narada Purana (Purva Bhaga, chapter 23) lays down how to keep it and the vow said at its start. The story of this particular Ekadashi is found in the Ekadashi mahatmya, the collection of stories told for each Ekadashi of the year, which attributes it to the Brahma Vaivarta Purana; some editions place it in the Padma Purana instead. In it Bhima tells the sage Vyasa that he cannot go a day without food, and Vyasa tells him to keep just one Ekadashi, the bright eleventh of Jyeshtha, without food or water, which will give him the merit of all the Ekadashis of the year. That is why the day is kept without water and is named after Bhima.
The one Pandava who could not fast
Yudhishthira, Arjuna, Nakula, Sahadeva, their mother Kunti and Draupadi all kept every Ekadashi fast. Bhima could not. He was called Vrikodara, "wolf belly", and the tradition says a fire named vrika burned in his stomach. When he went without food, it raged so hard that he could barely function.
His family kept urging him to fast, and Bhima felt stuck. He could give charity, worship Vishnu and serve his elders, but a full day without food was beyond him. So he went to the sage Vyasa, his grandfather, and asked honestly whether there was any way for someone like him to gain what his brothers gained by fasting.
Vyasa's answer
Vyasa did not tell Bhima to try harder at every Ekadashi. He offered one difficult day instead of twenty four impossible ones. In the bright half of Jyeshtha, when the sun is fiercest, Bhima should keep the Ekadashi without food and without water, from sunrise until sunrise the next day. Only the small sip of water used for achamana, the ritual rinsing of the mouth, was allowed.
If he did this one fast with faith, Vyasa said, he would receive the merit of all the Ekadashis of the year. Bhima agreed and kept it. That is why the day is called Bhimseni Ekadashi, Bhim Ekadashi, or in Gujarat Bhim Agiyaras. In east India it is often called Pandava Nirjala Ekadashi.
Why the hardest fast is also a gift
There is real kindness in Vyasa's answer. He did not shame Bhima for being built differently from his brothers. He met him where he was and gave him a path that fit his strength: one great effort rather than a hundred small failures.
The story also does not pretend the fast is easy. Going a full day without water in a north Indian summer is hard on the body. That difficulty is the point of the vow, and it is also why traditions make room for those who cannot do it. Elders, children, the sick and pregnant women commonly keep a lighter fast with water, milk or fruit. A fast that harms the body is not what Vyasa was asking for.
Giving water on a waterless day
Because the fast is kept without water, giving water to others is at the heart of the day. People donate clay pitchers and pots filled with water, hand fans, umbrellas, sugar, fruit and grain. Many give to temples, priests and anyone who needs it.
In many north Indian towns and cities, people set up stalls along the road, called chhabeel, and hand out sweet chilled water or sherbet to every passer-by. Strangers stop, drink and move on. The person giving it is often fasting without water themselves.
How the fast is kept
Those keeping the full fast bathe early, take a sankalpa, a quiet resolve, before Vishnu, and then avoid food and water for the day. They worship Vishnu with tulsi leaves, flowers and lamps, chant his names or the mantra Om Namo Bhagavate Vasudevaya, and many stay awake at night singing bhajans.
The next morning, on Dwadashi, the fast is broken during the parana window, the right time given in the panchang. Many first give food or water to someone else, and then drink water and eat a simple meal. Breaking it too early or too late is believed to lessen the fast, which is why families check the time carefully.
Bhima's fast is about more than food. The Gita (2.59) says that when a person stops feeding the senses, the objects fall away but the longing remains, and even the longing goes once one has seen the Supreme. Nirjala Ekadashi gives you a single day to see how strong your wants are, and to turn that attention towards God. Then it asks you to hand a cup of water to someone else, so that your own thirst becomes a way to understand theirs.