Food-web structure mediates dramatic effects of biodiversity loss including secondary and `cascading' extinctions. We studied these effects by simulating primary species loss in 16 food webs from terrestrial and aquatic ecosystems and measuring robustness in terms of the secondary extinctions that followed. As observed in other networks, food webs are more robust to random removal of species than to selective removal of species with the most trophic links to other species. More surprisingly, robustness increases with food-web connectance but appears independent of species richness and omnivory. In particular, food webs experience `rivet-like' thresholds past which they display extreme sensitivity to removal of highly connected species. Higher connectance delays the onset of this threshold. Removing species with few trophic connections generally has little effect though there are several striking exceptions. These findings emphasize how the number of species removed affects ecosystems differently depending on the trophic functions of species removed.