I saw this and thought 'Oh how I relate!' I think that many people do this on and off the spectrum, but I know that I personally take it to another level.
Being able to converse in a social situation is not natural to me. For some people, it can be, but it depends on the person and the situation. I have 'faces' I put on for specific places and people. There are different rules for how one behaves at work, or at a casual lunch with friends, for instance. These rules are not instinctual for me, so I have to cognitively list them, which in some ways very much feels as if I am putting on an act. It's not natural, or intuitive.
I explain it sort of like this. In my head is a big, big rolodex full of pictures that represent different social situations. When I go to an IEP meeting, I find the card that has the appropriate way to behave and look in that situation, for example. I overlay this with other clues that I can roll around and access by proxy of each other to come up with the proper things to say, wear and so on. I mentally have to prep myself. I pick what to wear, what might need to be said, and get a feeling of what to expect. If the situation is new, I might try to do some research beforehand to acclimate myself. If I don't have that sort of time I might try to quickly access the closest 'card' that I have currently on file in my head (experience) and apply the rules from that one.
So, for most people I'm sure that I seem like I am 'normal'. My hair is nice, my make up is on, and my clothes are arranged well in moments where appearance counts. I think that often times I may even seem to be more on top of things and together than others. It wasn't by accident, or due to me wanting to upstage. I'm most certainly not more together than the average mom, because I have some super power. It's because having all my ducks in a row, lots of prep and lots of order is the only thing that allows me to do what I do. This is my way of coping.
So, imagine what happens when I am minding my own business in a public place and I see someone I know. The routine is different and the context is off. This person is not supposed to be here in this environment! My brain scrambles to make sense, and in this moment I flee. It's not that I don't want to have smalltalk, because I dread the drudgery. The person I see may well be someone I like and want to talk to, but they don't belong here and I can't find my script. I know that if they try to talk to me there is a 50% chance I'll go mute and be unable to talk. The other 50% is okay, if my brain can align itself quickly enough to access the proper 'card' for this person. Words in social situations aren't free flowing. They are (unless I'm totally comfortable with the other person) hard to come by and rely heavily on pre-written scripts. So, I will, if I think I might get away with it hide, or at the least pretend I don't see them so at least they have to be the ones to take the lead in the conversation. I'll dive around corners and grocery store aisles in my attempts to not have to converse. I know that I have been caught trying to avoid people in these sorts of situations and it hurt the other person's feelings. I never meant to and I hope that if this ever happens to you that maybe you'll give the other person the benefit of the doubt that maybe they are struggling with a social issue and not take it personally.