We used the introduction of a generalist nest predator, the red squirrel Tamiasciurus hudsonicus, and of a large herbivore, the Sitka black-tailed deer Odocoileus hemionus sitkensis, to the islands of Haida Gwaii (Queen Charlotte Islands, British Columbia, Canada) to study how predator assemblage and habitat quality and structure influenced nest predation in forest birds. We compared losses of natural nests to predators on islands with and without squirrels. We selected nine islands with or without squirrel or deer and used 506 artificial nests put on the ground or in shrubs to further analyse variation of nest predation with predator assemblage and habitat quality for the predators. For both natural and artificial nests predation risk was higher in presence of squirrels. But predation risk varied within island categories. In presence of squirrels it was highest in stands with mature conifers where it fluctuated from year to year, in response to fluctuations in squirrel abundance. Vegetation cover around the nest had little effect on nest predation by squirrels. Where squirrels were absent, nest predation concentrated near predictable food sources for corvids, the main native predators, and increased with decreasing vegetation cover, suggesting that removal of the vegetation by deer increased the risk of predation by native avian nest predators that use visual cues. Predation risk in these forests therefore varies in space and time with predator composition and with quality of the habitat from the predators’ perspective. This temporal and spatial variation in predation risk should promote trade-offs in the response of birds to nest predation, rather than fine-tuned adaptations to a given predation pattern.