Biodiversity may provide insurance against ecosystem collapse by stabilizing assemblages that perform particular ecological functions (the “portfolio effect”). However, the extent to which this occurs in nature and the importance of different mechanisms that generate portfolio effects remain controversial. On coral reefs, herbivory helps maintain coral dominated states, so volatility in levels of herbivory has important implications for reef ecosystems. Here, we used an extensive time series of abundances on 35 reefs of the Great Barrier Reef of Australia to quantify the strength of the portfolio effect for herbivorous fishes. Then, we disentangled the contributions of two mechanisms that underlie it (compensatory interactions and differential responses to environmental fluctuations [“response diversity”]) by fitting a community-dynamic model that explicitly includes terms for both mechanisms. We found that portfolio effects operate strongly in herbivorous fishes, as shown by nearly independent fluctuations in abundances over time. Moreover, we found strong evidence for high response diversity, with nearly independent responses to environmental fluctuations. In contrast, we found little evidence that the portfolio effect in this system was enhanced by compensatory ecological interactions. Our results show that portfolio effects are driven principally by response diversity for herbivorous fishes on coral reefs. We conclude that portfolio effects can be very strong in nature and that, for coral reefs in particular, response diversity may help maintain herbivory above the threshold levels that trigger regime shifts.