There's no consistency and there's no rhyme or reason to it.
The one consistency seems to be that every culture does it. We all imagine some sort of higher order and that propensity for superstition is leveraged to enforce and enshrine behaviour.
I wonder if it could be shown that having this tendency is an evolutionary advantage that contributes to tribal cohesion and order as well as being a method for preserving knowledge across generations. It might be said to be instinctive.