An allegory is when we can take an entire story or passage and understand the whole thing on a symbolic level. Plato's allegory of the cave is an example that is used to explain how a person achieves education or enlightenment.
Plato asks his reader to imagine a cave in which prisoners are chained facing a blank wall. A fire is at their backs, and all the prisoners can see in the cave is the shadows of things that pass in front of the fire. They would never be familiar with the actual objects themselves, only the shadows of them.
Plato then asks us to imagine what it would be like for a person to escape this cave and to see objects in their true form in strong daylight. Plato points out that this process would be painful at first, and it would require our eyes to adjust to the light and our minds to adjust to new information. Plato also asks us to imagine how difficult it would be to transition from one state to the other—either from darkness into light (where we would be temporarily blinded by the new light),or light into darkness (where we would again be temporarily blinded and fumble around in the dark).
Plato's example is to demonstrate how people acquire new knowledge. People can be aided and led to knowledge, but ultimately, they must learn to accept and interpret it on their own. Plato points out that if a person with more knowledge of the "real" world returned to the cave, he would have great difficulty getting the prisoners to believe him about what the "real" world was like. Surely, Plato says, the prisoners would mock this man; they would have no way of understanding any alternate view of the shadows on the wall.
The process of leaving the cave is the process of education and enlightenment. It is sometimes painful as we readjust and learn to see new truths or new perspectives. A teacher or guide might try to help us out of the cave, but we are still the ones who have to learn to see with new eyes.