The living being has attachment for the present body and does not want to enter another, and thus in the interim he remains a ghost. If a living being who has already left his body has been pious, Yamaraja, just to give him relief, will give him another body. Since the living being in the body of the King had some attachment to his body, he was hovering as a ghost, and therefore Yamaraja, as a special consideration, approached the lamenting relatives to instruct them personally. Yamaraja approached them as a child because a child is not restricted but is granted admittance anywhere, even to the palace of a king. Besides this, the child was speaking philosophy.
People are very much interested in hearing philosophy when it is spoken by a child.
After giving up the body, one is transferred to another body, but sometimes, if one is too sinful, he is checked from transmigrating to another body, and thus he becomes a ghost. To save a diseased person from ghostly life, the funeral ceremony, or sraddha ceremony, as prescribed in authorized sastra, must be performed. Ravana was killed by Lord Ramacandra and was destined for hellish life, but by Lord Ramacandra's advice, Vibhisana, Ravana's brother, performed all the duties prescribed in relation to the dead. Thus Lord Ramacandra was kind to Ravana even after Ravana's death. We have heard of people's being haunted by ghosts.