Determinants of collective failure in excitable networks.