Allegories are works of art and literature that can come in many forms: story, poetry, music, painting or novels etc. in which the characters, images, figures, events act as symbols. An author may use allegory to illustrate moral lessons to convey actions of fictional characters that serve as symbols. Allegories can be explained to reveal a hidden meaning, their main objectives are often to teach a moral lesson. Allegories are a type of extended metaphor but they usually come in narrative forms.
An example of Allegory will be: A religious allegory with Aslan as Christ and Edmund as Judas in The Lion, the Witch, and the Wardrobe by C.S. Lewis