Background story.
Vikram was the king, obligated to take the ghost to the mendicant. Betaal was the Vedalam, the ghost riding on the back of the king, the storyteller and the savior of king Vikram who carried the ghost to a mendicant. The Vedalasm told a story to the king. King Vikram must give the correct answer. If not, the king's head would explode into 100 pieces. If he gave the correct answer, the ghost will fly off his shoulder to its refuge in the moringa tree, thereby frustrating Vikram to take Batal to its destination, where a mendicant was waiting for Betal delivered to him as prmised by the king. The mendicant would sit on the Vedalam, perform certain rites and rituals and thereby gain all the power in the world.

Vedalam is the analogue of west's Vampire. (Betall-Badal-Bedal-Betal-Vedalam-Vetalam = the ghost)
Here is a detailed story.
King Vikram held court and received gifts from the visitors. A mendicant gave him a fruit on every visit, which the king handed over to the royal storekeeper. One day, the fruit broke while being handled and a ruby came out. The king ordered all the fruits to be examined. All the stored fruits yielded rubies.
The king wanted to meet the mendicant, who proposed to meet him under a banyan tree in the center of the cremation ground on the outskirts of the city on the 14th day of the dark half of the month (waning moon). The king met him under the tree. The mendicant asked the king to go to the northernmost corner of the grounds, locate a moringa tree there, bring down a talking corpse (Badal) hanging from a tree branch, and take it to the mendicant. The mendicant wanted to sit on Bedal and perform certain rites, the idea being to kill the king and become the master of the world
En route, Batal would tell a story, and at the end, pose a question to the king. If the king knew the answer, he should answer, or else Vedala (Badal) would break the king's head. If the king spoke, broke the silence, and answered the question correctly, Batal would fly back to the tree. This happened 25 times (thus 25 stories). The king was supposed to deliver Batal to the mendicant according to the agreement.
Batal revealed to the king that the mendicant intended to kill him in order to gain all the power in the world. The king went to the mendicant, who tried to kill the king but ended up being killed by the king instead.
Undeterred in his repeated attempts to retrieve the hanging Vedalam from the tree, the man climbed up, brought it down to the ground, descended from the tree, and carried it on his shoulders to the funeral ground for delivery to the mendicant. The Vedalam spoke to the king, saying, "I don't understand why you loiter in the frightening cremation grounds."
Vedalam: "It seems to me that you exert so much effort to attain magnificent powers. Let me tell you the story of Kabali." Padmanabhan, a popular merchant in Manikkapuri, wanted to marry off his daughter, Pratyushaw, to Anandan, the son of his friend. A few days before the wedding day, Pratyushaw suffered an unusual malady—she lost her speech. Padmanabhan, the father of the prospective bride, fretted and fumed in frustration. Many physicians brought in from various towns administered treatments to no avail. One day, Dr. Dhananjayan examined her and said to Padmanabhan that his daughter's laryngeal nerves were paralyzed.
The doctor said, "Laryngeal paralysis is the reason for her inability to speak. Dasamulam, a concoction of ten medicinal roots, will help cure her paralysis. Dasamulam is available only on Snake Island in the Bay of Bengal, which is difficult to access."
Upon hearing the doctor's words, the emotionally charged father of the bride said, "Doctor, for Pratyushaw, I will bring Dasamulam from any corner of the world, even if it means losing my life in the effort."
Dr. Dhananjayan looked proudly at the merchant and said, "If you bring the herb with whatever effort you can muster, it will not only cure Pratyushaw but also benefit many others with the same illness. You don't have to go alone. Please take my disciple with you."
Anand's friend, Sivanathan, came forward to accompany him. Kabali, one among the gathered people, said, "I like derring-do. I'd like to be part of this journey. Let the four of us go."
The foursome began their journey on an auspicious day. They walked for several days, reached the seashore of the Bay of Bengal, and sailed on a catamaran towards Snake Island. During the first five days of their travel, they faced no danger. On the sixth day, a whale flipped its tail, breaking the catamaran into several pieces. All four of them were drowning in the sea. Sivanathan shoved a broken piece of the boat towards Anandan, who turned to express his gratitude to his friend.
But Sivanathan was nowhere to be found. Anandan saw the other two at a distance, holding onto the remains of the boat and floating in the ocean. Anandan was heartbroken to realize his friend was missing. All three floated, holding onto the pieces of the boat, and reached the shorefront of one of the hills in the ocean. They saw a flying saucer-shaped plate in the sky. They were surprised to see an old man land near them. He said, "Do not fear me. I am a human being like you. For a long time, I had a desire to fly in the sky. Over a period of time, I fashioned this flying plate." Anandan addressed the old man, saying, "Ayya! We were on our way to Snake Island looking for Dasamulam. Do you know where it is?"
The old man said, "This is Snake Island. Vanchinagar is on top of the hill. You must go on this flying plate. If anyone is prepared to sacrifice their youth, they can fly on this flying plate." Immediately, Sanjai came forward to sacrifice his youth and didn't budge despite Anand's objections.
Anand enunciated the mantra given by the old man and turned from youth to old age immediately. The old man became youthful and immediately handed over the flying plate to Anand.
Ananda and Kabali climbed onto the flying plate and reached Vanchinagar. What they saw in Vanchinagar shocked them. The town's youth, both male and female, had animal heads and human bodies. Only the old men and women had human heads and bodies. They didn't know whom to ask for the herbal medicine. They wandered around the area and reached an old woman's hut.
The old woman said to them, "Dasamulam is in the princess's garden, but the princess is captive to the mantra meister."
Kabali asked the old woman, "Who is this mantra meister? Why do young people have strange physical appearances?" The old woman said, "It is a long story. The mantra meister Mahāthamban was in love with the princess, but she didn't reciprocate his feelings. The mantra meister became angry and cursed all the young men, giving them animal heads. He spared the old people. The mantra meister said he would remove the curse if the princess agreed to marry him." As she narrated the story, the mantra meister passed by the street.
Immediately, Kabali confronted him and said, "I am here to suppress you. With utmost civility, withdraw your curse." The mantra meister replied, "Who the hell are you? I am the mantra meister Mahāthamban! Are you messing with me? See what I can do to you?" Saying this, he raised his mantra staff. Unexpectedly, Kabali jumped on the mantra meister and took hold of the mantra staff.
As the mantra staff changed hands, the powerless mantra meister ran to escape. Ananda and Kabali caught and tied him down. Soon, the princess came to know of the news and ordered her men to imprison Mahāthamban. She invited Anand and Kabali with royal hospitality and respect to the palace. Upon learning of their intentions, she gave them the herbs they needed from the palace gardens.
Before departing, Kabali, with the use of the mantra staff, performed certain exorcismal acts with the enunciation of mantras.
As they left Vanchinagar, Anand told Kabali, "There is no longer any need for the mantra staff. Throw it away."
But Kabali kept the staff with him. Both of them returned to the seashore they had left before. Multiple surprises awaited them. Sivanathan was alive and well. Sanjai had regained his youth. The old man with the flying plate had become old once again.
Sivanathan embraced Anand and said, "The ocean waves pushed me away in another direction, separating me from you. With great difficulty, I reached the seashore. Returning the flying plate to the old man, all four of us returned to Manikkapuri.
Thanks to the greatness of the Dasamula herbals, Pratyushaw recovered from her vocal paralysis. On an auspicious day and time, Anand married her. Kabali attempted to use the mantra staff to make a living, but the mantra staff malfunctioned and beat Kabali so severely that he had to flee town.
The Vedalam stopped telling the story and addressed King Vikraman, saying, "King! Did you see Kabali's fate? The mantra staff not only malfunctioned but also beat up Kabali. Is it true that the mantra sakthi helps and brings about the death of its handler? If you know the answers and remain silent, your head will explode into 100 pieces."
Vikraman replied, "What you said is not right. Sivanathan, Sanjai, and Kabali went to help Anand. Sivanathan saved the life of his drowning friend. Sanjai sacrificed his own youth to fulfill Anand's objective. Kabali, after seizing the mantra staff, used it for selfish reasons to earn money, which resulted in him being beaten by the staff and forced to flee town."
With Vikraman's correct response, his silence ended, and the Vedalam on his shoulders went away, taking refuge in the moringa tree.