Darwin himself doesn't go into much detail:
It is well known that several animals, belonging to the most different classes, which inhabit the caves of Styria and of Kentucky, are blind. In some of the crabs the foot-stalk for the eye remains, though the eye is gone; the stand for the telescope is there, though the telescope with its glasses has been lost. As it is difficult to imagine that eyes, though useless, could be in any way injurious to animals living in darkness, I attribute their loss wholly to disuse. In one of the blind animals, namely, the cave-rat, the eyes are of immense size; and Professor Silliman thought that it regained, after living some days in the light, some slight power of vision. In the same manner as in Madeira the wings of some of the insects have been enlarged, and the wings of others have been reduced by natural selection aided by use and disuse, so in the case of the cave-rat natural selection seems to have struggled with the loss of light and to have increased the size of the eyes; whereas with all the other inhabitants of the caves, disuse by itself seems to have done its work.This article has a bit more of the story.
The neutral mutation hypothesis suggests that eye degeneration is caused by random mutations in eye forming genes, which gradually accumulate in the absence of selective pressure. In contrast, the adaptation hypothesis suggests that natural selection causes the loss of eyes due to advantages in losing eyesight. As exclaimed in Darwin's famous quotation, the actual benefits of blindness are uncertain. Thus, different versions of the adaptation hypothesis have attributed the loss of eyesight to energy conservation, citing the high cost of making an eye, or to enhancement of other sensory organs that are highly beneficial to survival in the cave environment. Through the years, however, little or no experimental verification has been leveled in support of any version of either hypothesis. To understand the evolution of eye degeneration, it is necessary to determine the molecular and cellular mechanisms of the degenerative process, and whether the same or different genes and mechanisms are involved in loss of vision.
A detailed paper, and I'm not about to give away the surprising twist at the end. (Here's a hint: it's not that surprising.)