An allegory is a story which the author tells in order to share a moral or idea, or speak about real-life events. Examples include Plato’s Allegory of the Cave (in which Plato imagines people living in a cave in order to talk about how we perceive the world around us), The Chronicle of Narnia (where the lion Aslan symbolises Jesus Christ) and Animal Farm (where the animals and the plot stand in for historical figures and events of the Russian Revolution of 1917).
Allegories use symbols a lot. The characters, places, and events in the narrative will all symbolise something other than themselves. Writers use allegories to convey something complex in an interesting and understandable way.