For me the purpose of this allegory is the process of enlightenment and the explanation of the education of the soul in becoming wise.
In the Allegory of the Cave the predicatment in which mankind finds itself is described symbolically. The Allegory also present Plato's major philosophical assumptions: his belief that the world we conceive through our senses is not the reality yet a poor copy of it and reality can only be reached intellectually, not just learning knowledge but gaining wisdom.
In the first part of the Allegory an underground cave is described; called "the prison cave" or more metaphorically "the unenlightened world". In this cave, people or prisoners (as they are called) are chained to the cave wall so they cannot move at all. A fire is above them and behind them. The fire throws images on the wall opposite the prisoners. Another wall separates the prisoners from the fire and the guards near the fire. They can only see before them their own shadows and the shadows of other prisoners. sometimes the guards speak and the prisoner believe that the shadows are speaking. to the prisoners the shadows speaking are the truth because they can see it. In this way the cave, or prison house, is representative of the world of sight. Yet when the prison house is being described they so not say the prisoners are discontent, but rather comfortable with their current reality. This goes along with the saying "Ignorance is bloss" because they do not try to gain knowledge much less wisdom. They just stay content with their world.
Next is the journey or escape from the cave towards the sun, or pure being. The journey is from the unenlightened world to an enlightened world. In other worlds the journey is from the world of ignorance to the world of wisdom. The is when the prisoner that is trying to get out of the cave desires te freedom to explore. This urge pushes him to explore and search for something that in the beginning is not clear ...