Imagine that the year is 12019 — ten thousand years in the future. Humans long ago populated the galaxy — and almost as long ago, were effectively enslaved, Matrix-style, by a superior intelligence. They keep us alive in order to harvest a resource from us. They are really good at keeping us alive — so good that we’re effectively immortal. This is the case for billions upon billions of humans — alive, immortal, and enslaved.
And suppose that, to our terrible misfortune, the resource that this alien intelligence wishes to harvest from us can be extracted from each human in proportion to the magnitude of suffering experienced by that person. As a result, the aliens are maximizing not just our survival, but also our suffering. This is just about as bad as it gets.
Which would you prefer: that world, or the world in which it’s 12019 and all humans are extinct? Do you want existence with infinite suffering or non-existence?
The point is that survival is not enough. There’s something else that has to accompany survival in order for the world to be good. If we want to evaluate the goodness of a possible world, our evaluation must take into account not just the bare existence of humans, but also the degree of psychological suffering or happiness that they experience.
I think that Sam Harris uses this thought experiment or something like it in his argument for a science of ethics.