okay, I'm dumb, what does that mean?
On the deeper level the book (and tv series) is a search for the meaning of life.
Spoiler alert - They find the "super computer" and ask what is the "answer" to the meaning of life, the universe and everything. The computer tells them to come back in a million years or something. Even the most super computer in the galaxy wasn't that fast in 1979 - LOL...
When they come back the computer says the "answer" is 42. Of course they ask what does 42 mean and they are told to understand that you have to know the question. And the question is harder to determine than the answer so come back in a billion years.
In between all this of course they have a lot of adventures hitchhiking across the galaxy. Marvin was a "prototype" robot, the first with emotions. But the only emotions he got were paranoia and depression.
Some Marvin quotes -
“I could calculate your chance of survival, but you won’t like it.” –Marvin
“My capacity for happiness, you could fit into a matchbox without taking out the matches first” –Marvin
Marvin: “I think you ought to know I’m feeling very depressed.”
Trillian: “Well, we have something that may take your mind off it.”
Marvin: “It won’t work, I have an exceptionally large mind.“
[Discussing the police ship]
Marvin: That ship hated me.
Ford: Ship? What happened to it? Do you know?
Marvin: It hated me because I talked to it.
Ford: You talked to it? What do you mean you talked to it?
Marvin: Simple. I got very bored and depressed, so I went and plugged myself into its external computer feed. I talked to the computer at great length and explained my view of the universe to it.
Ford: And what happened?
Marvin: It committed suicide