The planet Earth was not a planet at all, but a gigantic computer of such amazing complexity that organic life formed part of its operational matrix. It was designed and programmed by another computer named Deep Thought, in order to find the Ultimate Question for a group of hyperintelligent, pan-dimensional beings who had recently found the Ultimate Answer to be "forty-two". It was built by the planet-manufacturing civilisation of Magrathea and placed in orbit around a miserable yellow star called Sol, deep in an unfashionable backwater of the Galaxy where it was most likely to be left alone. It was also, coincidentally, placed in a Plural zone, which can only be attributed to a planning oversight. The program was to take ten million years to run.
After eight million years had passed on the young planet, an arkload of fifteen million moronic Golgafrinchans, expelled from their home planet, crashlanded into a swamp in prehistoric Europe. Only a few hundred thousand Golgafrinchans survived the impact, but with their complete lack of respect for local wildlife and their admittedly superior technology, they eventually wiped out the indigenous cavemen - and a respectable portion of the Ultimate Question program, distorting the eventual output from the correct Question to read "What do you get if you multiply six by nine?"
Another two million years passed. The Golgafrinchans evolved and spread, forgot their extraterrestrial origins, and became the dominant life-form on planet Earth. Though the program still somehow continued to run, it had become utterly corrupted. Then, at lunchtime on an otherwise ordinary Thursday in early September 198-, just five minutes before the program was scheduled to be completed, the Earth was unexpectedly demolished by a Vogon Constructor Fleet. Though the reason given was that a hyperspace bypass was to be built through the Sol system, the actual reason was that Gag Halfrunt and every other psychiatrist in the Galaxy wanted to prevent anyone from ever finding out the Ultimate Question, and had employed the Vogons to do their dirty work.
The other Earth
There exists a near-infinite multiplicity of Universes, scattered across the vast spectrum or probability. In most of these universes there is a planet Earth. In many of these universes, Earth was demolished by the Vogons. In many others, it wasn't. Several years after the original Earth had been demolished, thanks to what has been described as "a fault line in the landscape of probability", a second Earth suddenly took the place of the first one, carrying on from the very second it had left off. A few seconds later the program ran to completion, but since Earth's hyperintelligent pan-dimensional overseers were not around to see it, nobody ever found out what the Question was.
All of the near-infinite multiplicities of the planet Earth were finally destroyed several years later still by a lost, confused Grebulon warship, which had been manipulated to do so via reverse temporal engineering on the part of the Hitchhiker's Guide to the Galaxy Mark 2. This ended the great experiment to find the Ultimate Question. The Guide Mk 2 had originally been researched, designed and created by Vogons, and funded by a staggering quantity of money provided by the amassed psychiatrists of the Galaxy.
For completeness: the Guide entry
The original entry for Earth in the Hitchhiker's Guide to the Galaxy read, due to space considerations and Earth's utter insignificance in every way, "Harmless".
Ford Prefect, a field researcher for the Guide, came to Earth in order to expand the entry. He intended to come for two weeks but ended up stranded for fifteen years, and in that time he wrote a very great deal about the planet - "text, diagrams, figures and images, moving desciptions of surf on Australian beaches, yoghurt on Greek islands, restaurants to avoid in Los Angeles, currency deals to avoid in Istanbul, weather to avoid in London, bars to go everywhere" (extract from So Long, And Thanks For All The Fish). This he transmitted off to the Guide offices towards the end of his stay. Unfortunately his submission was extensively cut down by the Guide's editing departments. For the most part of the Hitchhiker trilogy, the Earth was represented by the immortal phrase "Mostly Harmless".
Several years later, with Earth's baffling continuing existence, Ford's entry was restored in its entirety.