The answer is pretty much as qntm's, but it's complicated...
So the history of HHGTTG is that:
- There were two radio series
- There was a book series spanning several years diverging from the radio plot
- There was one TV series that diverged from the above
- There were other things like records/text adventures that diverged from everything else
- Douglas Adams died
- There was a film version which diverged from everything else
- There was another book commissioned by Douglas Adams' widow
Now you'll see the word "diverged" in most of that, this was (pretty much) all done/agreed to by Adams, certainly 1-4 (I'm sure he didn't agree on 5, but didn't have a choice).
Now there was a move by Adams to finish/continue the original (radio) series, but it was also just beyond reach. Adams was friends with award winning producer Dirk Maggs (Superman, Batman: Knightfall, Flywheel, Shyster and Flywheel), who Adams is reported to have said he would have wanted to finish the series.
Once Adams had died, Maggs did continue the radio series (and as it was "official" he got the living cast to play their parts). One sticking point remained, everything had "diverged".
So the decision was taken to remain as true to Adams books as possible without negating the reality of the radio series.
To do this took some backtracking/ingenuity and one part of which was the Bobby Ewing-esque "past was a hallucination" to explain things in the radio series which were contradicted in the books.
So don't think about it too much, just take them for what they are and enjoy.