Perhaps the quintessential story to illustrate the framework for Dharma is the Cosmic Fig Tree (Kalpataaru) story from the first chapter of the Rig Veda, the first of the foundational texts of Hinduism. Also related by Lord Krishna in the Bhagavad Gita, this story begins with some children playing with their sticks, stones and rag dolls on the floor of their hut when the proverbial rich uncle visits them. The uncle tells the children, “What are you doing playing with these things when the Cosmic Fig Tree is right outside your hut? Go outside and wish for whatever you want under the tree and it will give it to you. Then you can be playing with real toys instead of these trifles.”
The children don’t believe him. How could it be possible that such a wish-fulfilling tree even exists? So they wait until the uncle leaves and then they rush out to the tree and start wishing.
They wish for sweets and lo and behold, they get them. But they gorge on the sweets and get stomach aches. They wish for fancy toys and they get them. But they play with those fancy toys and get bored. Fancier toys lead to greater boredom. What they didn’t realize was that the tree always granted wishes in dualities: what was wished for, along with its built-in opposite. They had to accept both at the same time, for the universe was built up of such dualities only. The net result was that the children were miserable throughout their childhood, but they couldn’t stop wishing under the tree.
Then they became adults and they still came to the tree and wished under it all the time. Now it was Sex, Fame, Money and Power, the four main fruits of the Cosmic Fig Tree that they wanted. As always, the tree granted them what they wished for, along with the built-in opposite. With sex came jealousies, with fame came isolation, with money came worries and with power came palace intrigues. And the net result was just more misery and suffering. Now the wish-granting power of the tree had become widely known and there was quite a throng of people wishing under the tree. And they were also equally miserable and suffered throughout their lives as they wished and wished.
By and by, as they became old men and women, the children congregate under the tree once again to contemplate their spent lives. They are now in three main groups. The first group is the Cynics, who say, “This tree duped us throughout our lives and made us miserable. It's all been a hoax and a farce.”
They were fools, for they had learned nothing.
The second group, the Wise-guys, say, “We must have been wishing for all the wrong things throughout our lives. We will wish again for all the right things to make us happy.”
They were bigger fools, for they had learned less than nothing.
The third group, the Death Wishers were the most foolish of the lot. They say, “This tree ruined our lives and made us miserable. We wish we were dead.” And the obliging tree grants them their death wish, but they are immediately reborn underneath the same tree, for the tree always grants wishes in dualities.
Meanwhile a lame child had been watching all this from the window of the hut. He had wanted to wish for a good leg so that he could walk, but he was pushed away by the throngs of people crowding under the tree and he wasn’t strong enough to get through. But as he watched from the window, he was awed by the spectacle of the tree. He saw his friends wanting sweets and clutching their stomachs with pain. He saw them grabbing their fancy toys and getting bored with them. He saw them wishing for sex, fame, money and power and suffering through their built-in opposites. As he witnessed the misery and suffering of the wishers, he began to understand the true nature of the brilliant cosmic swindle that was being enacted under the tree. With that understanding, he felt a well of compassion rise up from within him, not only for the wishers but also for all the creatures that were affected by the wishing. Through that gratuitous, all-encompassing compassion, wherein he sought no benefit from that compassion, the lame child lost his desire to wish and ensured his lasting happiness. He had sliced that fig tree with detachment. He had stepped outside the orbit of Karma and had done the pure act of kindness, Nishikama Karma. He was, without doubt, the happiest of the lot.
The Cosmic Fig Tree is, of course, the unsentimental universe and the wishes that it grants usually require creating some form of "order" in the universe. Such order is always accompanied by enough disorder so that the net disorder, or Entropy, in the universe constantly increases. This is known in physics as the Second Law of Thermodynamics. This is the source of the built-in opposites in the wishes that the Cosmic Fig Tree grants.
 The Cosmic Fig Tree Story is drawn from P. Lal's excellent exposition in the Introduction of "The Bhagavad Gita," Lotus Collection Roli Books, 1994. http://www.rolibooks.com/lotus/lotus-collection/-/the-bhagavad-gita/