In Hinduism(and other similar religions in India), The soul, that one possesses, is considered as a part of the divine (the creator) and one is supposed to be reincarnated as one of 8.4M species (a number, in old scriptures) according to his/her Karma in present life.
Now, if one is wise enough to recognise this never ending cycle of rebirth and acts according to Dharma, the soul may reunite to the divine (called Moksh or Nirvana).
Now scriptures are filled with examples and their Karmas. Few are said to be achieved this by getting free of all attachments, going in Samadhi (a long state of being motionless, self-reflection and thinking) and then mending their ways by some realisation.
That's the 'thing' the prince is trying to achieve here.