Sometimes, history or mythology provides fodder for story ideas. I'm sure you've come across an example or two before. Especially if one (or both) of your main characters is a god or historical figure.
If that is the case, mythological and/or historical events will have a bearing on your character, but they do not necessarily need to be worked into the story. Things in the past can be mentioned casually, discussed at length, or shown in a prologue or flashback.
But when is it necessary to include a mythical event?
In my opinion, there are two reasons to do this:
1) It develops the character
This is the way most commonly seen. Again, this can be done in two ways—through the prologue, and through a flashback. Significant scenes in the character's past, usually revolving around the main plot or a difficult moment which shaped the character into who he or she is, are shown through these methods. An example is in Kresley Cole's book Wicked Deeds on a Winter's Night. Because Bowen believed his past mate to be dead, falling to her death when running away from him on a full moon, Cole replayed that scene to showcase Bowen's anguish. The scenes can be used to show the death of a loved one, the betrayal of your main character by someone close or unexpected, or an event which prompted the character to follow the path he or she is currently on.
2) It is a part of a curse, prophecy, etc.
Like in The Curse of Nefertiti by Charline Ratcliff, which we visited last week in a review, another reason to include a mythical event would be because your character is either cursed, or the hero of a prophecy. In that specific example, Kayla was the latter; the responsibility of going back in time and saving the Egyptian people rested on her shoulders.
However, for this reasoning, the mythical event does not necessarily have to take place in the past. If your character is under a curse or the hero of a prophecy yet to come true, you could easily work those events into modern day. Let's take Norse mythology for instance. Ragnarok, the end of the world brought upon by the trickster god Loki, could easily take place in modern day if you so desire, instead of in the past.