The element that makes a story an allegory is
symbolism.
An allegory is a figure of speech similar to a metaphor - however, unlike metaphor, it can stretch throughout the entirety of a literary piece. It is based in symbolism, meaning that there are some hidden meanings that you need to uncover through analysis.