The full account of this lifetime is told in the Maha-Ummagga Jataka (#546), while the Panca-Pandita Jataka only relates this single incident from that story.
The Bodhisatta was once a king’s advisor. Senaka, King Vedeha’s chief advisor, was jealous of the Bodhisatta and wanted him dead. Senaka asked him whether it was ever okay to share a secret, and the Bodhisatta answered no. Knowing the king would disagree with this, Senaka told the king the Bodhisatta was a traitor and to prove it he should ask the Bodhisatta who secrets should be shared with. The next time all five of his advisors came together, the king asked each of them this question.
Answering his own question first, the king said that if they are virtuous, faithful, affectionate, and subservient to their husbands, secrets should be told to wives. Senaka and the others each gave friends, brothers, sons, and mothers as examples of who to trust. When the Bodhisatta answered that wise men always keep secrets to themselves, he saw the displeasure on the king’s face and realized he was being tested. Not trusting the foolish king, the Bodhisatta promptly left the palace. Right after he did, the king gave Senaka his own sword and ordered him to chop off the Bodhisatta’s head when he returned the next morning.
The Bodhisatta surmised that his four rivals had shared a sinister secret with the people they mentioned as trustworthy. Knowing that after their meetings with the king the four always sat on an overturned water trough next to the palace door and chatted, the Bodhisatta climbed underneath it to spy on them. When they sat down, the men asked Senaka if he’d ever shared a secret with a friend and he admitted he had, but it was too important to tell: If the king ever found out, he’d be executed for it. And what if the Bodhisatta was lying under the trough listening? The men mocked his worry and promised they could be trusted. So Senaka mentioned a well-known woman who had gone missing, and he admitted to having sex with her in a grove of trees and then killing her to steal her jewelry; and only his friend knew.
Then the others revealed their darkest secrets, which they had only ever shared with the one other person. One had a spot of leprosy on his thigh that his brother washed and bandaged each morning, and when the king got sad he would cry and unknowingly lay his head atop it. Another got possessed by a goblin every evening on the holy days and barked like a mad dog, so his son needed to tie him up indoors and host a party to hide the noise. The last had stolen the king’s lucky octagonal gem for his mother, and he always took it to the palace with him, which is why the king spoke to him first and gave him so much money.
That evening, King Vedeha thought about all the good things the Bodhisatta had done for him over the years and regretted ordering him executed. Queen Udumbara noticed his grief and he told her the Bodhisatta would die the next morning. She was aghast, but hid her feelings from the king. After the king fell asleep, she sent a message warning the Bodhisatta what was planned for him at the palace.
Arriving early the next morning the four advisors stood at the palace gate, but the Bodhisatta stayed away until after they went inside. Then, in the company of guards and a great crowd of people, he safely approached the palace and saluted the king, who, playing dumb, invited him in. The Bodhisatta told the king he knew his secret, that he’d ordered his beheading. (But to protect the queen, he did not admit she told him.) Then he revealed the other four advisor’s secrets, offering this as proof that he was right and secrets should be kept to one’s self. The furious king ordered the four men executed, but after they’d been given one hundred blows at every street corner, the Bodhisatta suggested they be pardoned and the king consented.
In the Lifetime of the Buddha
One day some of the Buddha’s disciples were discussing his supreme wisdom. In particular, how he had humbled and converted a vast multitude of brahmins, ascetics, thieves, goblins, gods, and more. When the Buddha heard them talking about it, he told them this story so they knew he’d had perfect knowledge in the past too.
King Vedeha was an earlier birth of Laludayi, an elder disciple of the Buddha who was so shy that he could not speak when around more than a single other person, and he often said one thing when he meant another. Senaka was an earlier birth of Saccaka, a Jain who converted to be a disciple of the Buddha, and the other three advisors were Potthapada, Ambattha, and Pilotika, three ascetics who respected the Buddha.