Magic? No. Aunt May was shot and dying. So he talked to the Devil. He traded his marriage for Aunt May to live. Both he and MJ only paused briefly before changing their lives forever in order to stop a 93 year old lady from dying from a gunshot wound. But wait! Everyone knows Spider-man is really Peter Parker! If only there was some way to make this go away, because hey, that's why Aunt May was shot, right? MJ steps up to the plate and tells Mr. The Devil "I will let you have this unborn baby in me that I told no one about if no one remembers he was Spider-man." The Devil nods. Then POOOOOF! (well, BOOOOONG!) And it goes back!
But see, not just everyone knew about Peter. A lot of heroes did too, so Petey unmasked himself in front of the heroes and they instantly remembered everything. So now the FF and Daredevil and the Avengers and everything know that Peter Parker changed the history of the world for the last X years. Because a lot of changes happened in New York.
Right now, they are going through EXACTLY why they aren't married. Even though people have finally just accepted it. They were fine with the handwave "it never happened." But NOPE! They aren't married because [spoiler]Spider-man was late for his wedding. Because a fat guy fell on him. And he was knocked out. Of course, in order to believe this you have to forget the umpteen times a building fell on him and he stood up and pushed the building off. Oh well. That was the Devil's master plan. A fat guy. [/spoiler]
I am only touching some quick things. If anyone wants to go over anything I missed, go right ahead.