In the early 1960s, Martin Goodman told Stan Lee to reinvigorate the Marvel Comics line. Among his other decisions, Lee set all the stories in a single shared reality. Events in one title could affect characters in another, and heroes (or villains) in one narrative could show up elsewhere. When Lee wrote nearly all the stories himself, keeping things straight was difficult but not impossible. With multiple writers, the problem got worse. After decades of varying success, the internal consistency became harder and harder to maintain. Too, the accumulated history made it increasingly difficult for writers and artists to do anything truly creative. What If? represented a first step away from this dilemma.
The framing device for the first What If? series is its narrator, the nearly omniscient Watcher. He presents each story as set in a parallel universe where the events actually happen. Up until the crucial moment, however, the previous history applies; in other words, the new story is based on all the old stories. Nine issues also included "Untold Tales from the Marvel Universe," mostly about the Eternals. Many issues included a second (often humorous) story, such as, "What If ... the Spider Had Been Bitten by a Radioactive Human?"
As an example, What If? #1 asks, "What If Spider-Man Had Joined the Fantastic Four?" In the early days, Reed Richards and Susan Storm quarreled frequently. At one point Sue seriously considered an offer of marriage from Namor. In the original continuity she turned him down, but in this story she accepts. From that point on, the "mainstream" continuity ceases to apply. Because she leaves the Fantastic Four, Reed recruits Spider-Man to take her place (hence the title).
The first series ran for 47 bimonthly, double-sized issues. Declining sales (as well as a scarcity of good plots) led to its cancellation after the October 1984 issue.
A single What If? Special appeared in June 1988. Sales must have been good, because a new series began in July 1989. At first it featured the Watcher and stories that split from the mainstream continuity with a single event, just as Volume 1 did. This time the writers and artists asserted their creativity and gradually disassociated the title from the mainstream continuity. The Watcher dropped out in issue #77. The cover itself changed in issue #88, announcing only that a particular character would appear. A story might split from an earlier What If? reality or take place in an alternate reality entirely, thus having no direct connection at all to the mainstream. In other words, the stories used unfamiliar settings for characters who might or might not be familiar. Anything was possible.
During this time Marvel resolved the continuity issue. Events that contradicted the mainstream reality, or didn't fit into it at all, were explained away because they happened in other realities (see Multiverse). The original, mainstream reality became Earth-616, only one among many. Any sort of story could happen in any sort of reality.
The second series ran for 114 monthly issues. It was cancelled after the November 1998 issue.
In February 2005 and again in February 2006, Marvel published six What If? issues. Volume 3 looked more like Volume 1, with the plot summarized in the title, such as What If Doctor Doom Had Become the Thing? Volume 4 went in a new direction, putting popular characters in historical situations. The framing device in Volume 4 also changed: the stories are presented as multimedia documents found by a hacker (whose handle, fittingly enough, is Watcher). In both volumes, each title is #1, so there is no series per se.
In August 2005, Marvel published Wha...Huh?! a spoof of What If?
After robust sales of Volume 4, Volume 5 got the green light and began appearing in November 2006. These issues were tied to important storylines: Age of Apocalypse, Avengers Disassembled, Spider-Man: The Other, X-Men Deadly Genesis, and Wolverine: Enemy of the State. This series also sold well.