The story is considered an allegory. An allegory is defined as

Aan account that includes mystical actions and unknown terrors.
Ba narrative written specifically to teach a moral or lesson.
Ca story with a literal meaning and a symbolic meaning.
Da tale that recounts the actions of heroes or heroines.