When used figuratively (which it usually is) it means something's predictable (or viewed as predictable, even if it's an exaggeration.) It can be used for good things and bad things but I find that it's a little more likely to say about mildly bad things.
"Ug, there's cilantro in this. I specifically said 'no cilantro.' It never fails." Notice that perhaps this person always requests that the cilantro be held, but perhaps 25% of the time the cook forgets to hold the cilantro. The speaker is exaggerating it to be 100% by saying "It never fails" as a means to complain about how often it happens when it shouldn't happen.