Selective mutism is very often the result of a retained infantile fear paralysis reflex, which is triggered, as the name indicates, by fear, so there is certainly an anxiety component, but it is also a physiological response that makes speech impossible while the reflex is activated.