Masking is a survival skill.
Some people call it camouflaging, because like chameleons, you do it to blend in.
You're right that not everybody has the capacity to do this because it requires the skill of the perception of the world outside of yourself, but having a perception of the world outside of yourself isn't part of the diagnostic criteria, it's simply part of a spikey profile.
Masking can also look different for everyone who does it because it depends on your environment. For me, it's rehearsing scripts both before and after they've happened. It's constantly analysing what was said, how it was said, to the point I even mimic people's accents without realising I'm doing it. I spent a week working with 2 Romanian colleagues who thought I was mocking them, but I wasn't, it was just the way my brain was processing language at that time. Sometimes, like at the wedding reception I was at on Saturday, it's needing a drink just to be able to speak at all because there's so much input in every direction. It's practicing little phrases for when people catch me behaving weird to justify my weird behaviour like "Sorry, I'm a bit deaf, could you say that slower?" For when they have an accent I can't register, or "I'm just counting something" if people catch me stimming with my fingers. It's grinding my teeth to a pulp so I don't run off when I hear people slurping or gulping.
There's a lot more that goes into masking, and some people are definitely capable of it for a lot longer than others.
Unfortunately it's psychologically exhausting and I know many people who haven't been able to keep it up and that's what has lead to late diagnosis in them, but you still need an incredible amount of proof that this has been present since childhood.
It's been a great comfort to me since my diagnosis that all of those times I had my bum smacked, sent to the chair, sent to bed without food, pulled my hair out in chunks because I wish I could have just done as I was told or not cried and promised myself I'd not do it again and then done it again weren't because I was being a drama queen, attention seeker, controlling little brat, primadonna and the swathes of other names I'd been called, but because I was actually in a neurological state of crisis beyond my control and it couldn't have been helped, and it was for the adults around me in my formative years to recognise that. It's helped me understand them and forgive them because back then diagnoses especially for women and girls were exceptionally low.
I was diagnosed just before I turned 29. My son was diagnosed age 3. According to family we were exactly the same at that age. A lot of "I wonder where he got that from" tongue in cheek style comments, but the wider understanding of autism means he'll never have to go through what I went through my entire life where I wasn't supported to improve, I was beaten and chastised and shamed and embarrassed throughout my home and school life.