Marine heatwaves (MHWs), increasing in duration and intensity because of climate change, are now a major threat to marine life and can have lasting effects on the structure and function of ecosystems. However, the responses of marine taxa and ecosystems to MHWs can be highly variable, making predicting and interpreting biological outcomes a challenge. Here, we review how biological responses to MHWs, from individuals to ecosystems, are mediated by fine‐scale spatial variability in the coastal marine environment (hereafter, local gradients). Viewing observed responses through a lens of ecological theory, we present a simple framework of three ‘resilience processes’ (RPs) by which local gradients can influence the responses of marine taxa to MHWs. Local gradients (1) influence the amount of stress directly experienced by individuals, (2) facilitate local adaptation and acclimatization of individuals and populations, and (3) shape community composition which then influences responses to MHWs. We then synthesize known examples of fine‐scale gradients that have affected responses of benthic foundation species to MHWs, including kelp forests, coral reefs, and seagrass meadows and link these varying responses to the RPs. We present a series of case studies from various marine ecosystems to illustrate the differential impacts of MHWs mediated by gradients in both temperature and other co‐occurring drivers. In many cases, these gradients had large effect sizes with several examples of local gradients causing a 10‐fold difference in impacts or more (e.g., survival, coverage). This review highlights the need for high‐resolution environmental data to accurately predict and manage the consequences of MHWs in the context of ongoing climate change. While current tools may capture some of these gradients already, we advocate for enhanced monitoring and finer scale integration of local environmental heterogeneity into climate models. This will be essential for developing effective conservation strategies and mitigating future marine biodiversity loss.