Allegories bear similarities to parables and, at a more fundamental level, to metaphors. The main distinction is usually the length of an allegory and the number of detailed correspondences between the allegory and its interpretation. A metaphor is a single image, and a parable is often a very short story intended to vividly communicate one point. An allegory, by contrast, may follow a character through a long series of encounters and experiences, each of which represents a different thing in real life.
Allegories, if done well, can help your writing communicate a complex emotional, experiential or spiritual idea by breaking it down into pieces and comparing it to more common experiences. Begin by clarifying what it is you want to communicate, such as the difficulties and joys of raising a child. Break your message down into elements, and find a corresponding concrete image that bears some similarities to each abstract element, such as a meteorite striking a calm field to represent the sudden disruption the birth of a baby brings.
In general, an allegory will have a key concept that can be used to derive what the writer meant the allegorical elements to represent. The key may be revealed by the names of the characters and places, which may be named after things they represent, such as virtues or life events. The context in which the allegory appears may also help reveal its meaning. In some cases the allegory is a story told by a character who will then go on to interpret it.
Writers have communicated important ideas through allegories for millennia. Plato's famous allegory of the cave represents the common man's ignorance of transcendent forms by describing a cave where prisoners can only see shadows instead of the real objects casting those shadows. Dante's "Divine Comedy" is an extended allegory in which the narrator travels through hell, purgatory and heaven, encountering characters and situations that represent theological and political realities with which Dante was concerned. Another famous religious allegory is "Pilgrim's Progress," by John Bunyan, in which the main character makes a journey representing the Christian experience.