When a dentist performs an indirect pulp cap on a tooth with a deep cavity, he does not expose the 'nerve' . Instead he leaves a small amount of 'suspect' tooth structure called affected dentin in between the nerve and the cavity preparation. He usually places a medication over the affected dental such as calcium hydroxide that dries out the dentin and stimulates the formation of sound secondary dentin.
If in the process of cleaning out 'decay' the nerve is exposed, it sustains and injury that it may not be able to recover from. The thinking behind this procedure is that by not exposing the pulp directly, a root canal may be avoided, and the tooth will be OK with a final restoration, assuming the tooth remains asymptomatic.
Some dentists advocate leaving a sedative filling in the tooth as an interim restoration and after a long period of time taking it out and completely removing any soft dentin that remains. It is my observation that the Calcium hydroxide has the effect of desiccating the affected dentin and I do not usually have to go back to remove the affected dentin does not actually need to be removed at a later time.