From what I recall, there was some... thing... somewhere... that said it could calculate the meaning of life or something, and after years and years, the inhabitants of the area gathered back to get the answer. The thing said, "42."
You may wanna find someone who actually has a better understanding of this. I didn't know this was a book before I saw the movie, and that I needed a good understanding of sci-fi knowledge to understand it. But even the people who told me this mentioned that they didn't really care for the movie too much.