Spontaneous recovery of fear after extinction is a well-established behavioral phenomenon. Different theories in psychology account for spontaneous recovery by proposing that it may result from temporal weighting, reduced processing of stimuli over time, enhanced salience of adverse events or return of the acquisition context. We propose a novel mechanism of spontaneous recovery: selective maintenance of adverse events, and ground this mechanism in a computational model of latent cause inference. To investigate the proposed mechanism, we collected behavioral data with an aversive conditioning and extinction task (N=280) and fit the data with computational models formalizing our and others' theories. Quantitative and qualitative model comparisons indicated that selective maintenance of adverse events accounts for spontaneous recovery better than alternative theories. As spontaneous recovery of fear after extinction can serve as a model of relapse after exposure therapy, we use this mechanistic understanding of spontaneous recovery to propose and simulate the effect of add-on interventions to prevent relapse after exposure therapy.