In fact, the theory of evolution proffers exaptation as a well-recognized, well-documented explanation for how systems with multiple parts could have evolved through natural means.
Since the essential requirements for cave life were probably already present prior to the settlement of these habitats, this may be described as exaptation.