The Bodhisatta was once a king’s advisor. The full account of this lifetime is told in the Maha-Ummagga Jataka (#546) while the Sabbasamharaka-Panha Jataka only relates this single incident from that story.
As a seven-year-old boy, the Bodhisatta was already incomparably smart and King Vedeha had a man observe him while deciding whether he was the wise man whose coming had been predicted in a dream. During this time the Bodhisatta performed many remarkable deeds, including judging the All-embracing Question.
A poor, elderly woman made a necklace by tying together threads of various colors. When she went to bathe, she laid it on her clothes and a young woman admired it and asked to try it on so she could check the size for making one of her own. The old woman said yes, and the young woman put it on and ran off. The old woman quickly got dressed and chased the thief down. The Bodhisatta asked each woman what fragrance they used for the necklace. The young woman said it was a fancy blended perfume while the elderly lady answered that she could only afford panic seed flowers. The Bodhisatta put the necklace in a bowl of water and asked a perfume seller to come smell it. He identified it as panic seed flower and the exposed thief confessed.
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.