Selective mutism is not synonymous with shy
Less than 1% of kids in the U.S. are impacted by a rare anxiety disorder called selective mutism. The anxiety disorder is characterized by a person, often a young child's, inability to speak in social or public settings. Initial symptoms often coincide with starting school, where the child may appear inordinately shy, but in fact they cannot speak due to heightened anxiety even though their communication is unencumbered at home or other comfortable settings.
Anxiety is essentially an uncontrollable and all-consuming fear. When a child is prompted to speak, the fear attempts to protect them by avoiding verbal interactions altogether. It's reasonable for adults to view this behavior as shy or timid, but this isn't a rule of having selective mutism or any anxiety-related disorder. Shyness is a personality trait.
Shyness "is not characterized by extreme inhibition that interferes with a person’s daily functioning like mental health disorders including selective mutism, social phobia, and avoidant personality disorder."
When I was in kindergarten, adults thought I was downright rude by not speaking to them. I wished I could, but the only way to communicate at that time was hiding behind my mom's legs and crying when she told me the principal was suggesting I switch to a school for the deaf and mute (which didn't happen).
There was soccer with no yelling, lunch with no "please," only pointing, and so many math assignments ripped from my hands by curious classmates trying to get a rise out of me. No matter what, I didn't speak. I'd whisper in my teachers' or friends' ears. When we left for each others' houses for playdates, I was bouncing off the walls just as loud and unhinged as at home.
Read: I was not shy then, and I'm certainly not now.
Selective mutism is not limited to kids, it can be diagnosed in adults. The only other person with selective mutism I've ever met was an eighteen-year-old who still struggled with finding their voice. I couldn't believe the luck and chance that I'd seemingly "grown out" of the condition after a very encouraging and understanding second-grade teacher who handed me a pencil and told me if I couldn't speak, I could very well write. (and now I'm here, iykyk !)

I couldn't imagine how isolated the eighteen-year-old must have felt, still silenced against their will at that age. The social stakes were high, as we'd just started university. I could empathize with her, but I recognized how far removed I was from the days when I tiptoed across the carpet during grade school story time to whisper questions or answers in my teacher's ears.
Even though I snapped out of the selective mutism, anxiety and low self esteem never left, all becoming the next mental burden I carried in silence. No wonder I eventually wanted my body to shrink as I slipped into anorexia nervosa. I was never shy, but I've never craved the spotlight, either. As long as I was talking, high performing, and volunteering for every opportunity in my way, I figured I'd eventually "snap out" of the inner turmoil and self doubt.
In the second blog I ever published, I mentioned my selective mutism, and less than 24 hours later, a family reached out to share their story. I remember them now, a year later, and am thinking of them as I write. This is for anyone looking to have even a glimpse of what it's like to experience the disorder.
If I can offer my two cents, I don't think "snapping out" is how mental illness symptoms work. If you or your loved one has experienced selective mutism and is speaking in all settings now, wonderful. Ask them or yourself how they're doing. Anxiety is a tricky illness, and it is absolutely possible to recover.