Once upon a time in Kosala during the rainy season, war broke out on the borders of that nation. The troops stationed on the border, after two or three battles, were forced to retreat and seek reinforcement. The King, despite the rains, rushed from Savatthi to take the field - but the going was slow on account of the rains and he encamped at Jatavana Park. There, in the dampness, he thought to himself "this is a bad season for a war. The road is muddy and every low spot is full of water. I am not confident that even should I reach the border, I am not certain I would be any more successful than the garrison there was. I should seek advice."
So the King went to visit the Buddha Gotama, who was at that time only a little ways away.
"Where are you going, King, at this unseasonable hour?" asked Gotama.
"I am going to quell an attack on my border - - - But before I went I wanted to bid you fairwell."
Gotama knew this was not wholly true. "This is not the first time you needed my advice before setting out to war, and finding your courage lacking so you became dumb, did not ask for it." Gotama spoke both of this life and another, and the King asked him to explain. Gotama said,
When Brahmadatta was reigning in Benares, he had a Counselor who was a trusted advisor, both in spiritual and temporal matters. There was, during a rainy season, an invasion on his borders and the troops there were forced to retreat, and sought reinforcement. The King rushed to defend his borders, but had to camp in a park. In the cold rain, the soldiers steamed some peas for the horses to eat, and then poured them into a trough. One of the monkeys that lived in the park jumped down from the tree, filled his mouth and hands with peas, and then ran into a tree to eat these peas. Upon sitting down to eat, it chanced that a single pea fell from his hands to the ground! The monkey did not know what to do, and being a dumb animal, couldn't ask if he had the courage to. So the monkey did what he thought best: at once he dropped all the peas from his hands and mouth and ran down the tree to search for that lost pea. But the pea he could not find - and in doing so had lost all the other peas he had. By now the soldiers had noticed his theft, and were guarding the troughs - there would be no more peas for the monkey. So the monkey sat down, sad and discouraged, like someone who lost a thousand in some lawsuit. The Counselor pointed this out to the King, and said: "King, this is what fools will do: they spend a dollar to win a penny."
The Counselor then sang quietly,
"A foolish monkey, living in the trees
his hands both full of peas
threw them all away so one he might see
There is no wisdom in hands like these
So are we, so are all those whose heart greeds.
Will you lose much to gain a little
like this monkey and his pea?
Upon hearing this, the King turned and went back to Benares. And the invaders, who had heard from their spies that the King was ready to set forth from his capital to destroy his enemies, hurried away from the borders, and made reparations.
The Buddha Gotama told the King, "in those days, Ananda was the King of Benares, and I was the wise Councillor."
The King of Savatthi, after listening to the Buddha Gotama's story, kindly thanked Gotama, and took his leave, and went back to Savatthi.
And the invaders, as before, left in fear of reprisal.