Epigenetics and divergent neurology.
The "gunkle" theory suggests that if/where a group of humans is the unit for genetic selection, there is survival advantage to having a capacity to generate individuals whose productivity contributes to the group in general, rather than striving to compete for/gain/keep a female spouse and raise their own offspring. The epigenetic switches would be triggered by environmental conditions. It's been suggested that lots of children, or high stress in the gestating woman could be triggers.
Regarding autism, I don't think it's controversial to say that societies benefit from having individuals who specialise in different areas of productivity. Specialisation leads to a higher degree of skill and better technology being available to the group.
It's also fairly plain that for someone to specialise effectively, they can't be a 100% generalist in seeing to all the things that need to be done to maintain a lifestyle compatible with a complex society. So there's trade of specialisations; the textiles specialist trades with the flint knapper, the flint knapper trades with the carpenter, the carpenter trades with the butcher etc etc. And on a domestic level, a person, traditionally a woman, maintains the household in all the ways that their family and society requires. These people - usually women - don't specialise because they are the support crew for the people who do specialise. And in return, the specialist works hard to advance their knowledge and skills, excels in their field and brings wealth and status to their family, and their community. And their culture/family/society has the selection advantage over societies in which people are individually expected to each do everything for themselves, so have little technology or time to develop and build on it.
I hope this makes sense so far. The benefits of specialists, and a society which is structured to support them, has an advantage. But... what society would have an advantage above and beyond that? What if a society were *forced* to support individuals who were predisposed to intensely focus on narrow fields of interest?
Civilised societies are often judged as such by the way they treat their less fortunate. The sick and infirm are not dragged into the woods and left to the elements; they are cared for. So, what if someone were impaired in a way that required their family or society members to support them, and that impaired individual were coincidentally really strongly predisposed to learn everything there was to learn about a given craft, and then to practice that craft, become a master at the craft and pass on their improved techniques to future generations? Wouldn't that put the society's development in the fast lane compared to other, neighbouring/competing groups?
So if, by some epigenetic accident, a group were to sporadically generate individuals who had to be supported by family/the group, who had an inclination to hang out with adults when they are a child, and to hang out with children when they are an adult, loves to talk and learn about their specific field of interest, and excels at their specific field of interest, that would set up the society to both gain technology more rapidly, and to maintain the knowledge and skills, building on those skills generation after generation.
Autism is a complex set of traits, not all expressions and combinations will be beneficial, but not all have to be - only enough to provide the group with a survival advantage overall.
Triggers could be anything from high stress in ancestors for some number of generations, famine after years of bounty, bounty after famine, lots of study (because that will change your brain), lots of technology, lots of people... so many possibilities!
IIRC I wrote this here because it came up as a tangent on a discussion of the gendering of emotional labour. That relates to this because of the fact that the default specialist is male, and the default generalist is female. I assume this is because women lactate, so they stay at home with the baby/children/elderly while the men go out to raid the neighbouring village/defend the village from raiders. "Women as domestic slaves" is very common throughout history as I know it. Women keeping house while the man is at war/working with machinery/making another one of his crazy "inventions"/being a brain surgeon etc is another, gentler version of that same trope.
Men* get the benefits of being a specialist without the obligation to be as productive as a genuine specialist. It's a really sweet deal, but in order to justify it, society has to assume that women all naturally be and do all things that are required of a generalist. Men don't question the fact that women are responsible for doing pretty much everything that they, as men, choose not to do. They take the life's work of the women who are their support crew as their due. The woman does her duty in society; support the man so he can do amazing things for the benefit of all. Often men work very hard, some try all their life to contribute something amazing, but some just hang out with mates, drinking or killing pixels clocking up untold hours in online games, never imagining that the woman who does their housework might prefer that he did it himself so that she could do something else.
The imbalance in workload and opportunity can't be unjust if it's 'just natural', right?
That assumption is the first error. The second error is the idea that because genuine specialists are seldom adept at doing emotional labour, and all men are specialist, then men 'just naturally' don't do emotional labour.
So if women are expected to "just naturally" do emotional labour, the question comes up: why aren't more autistic girls noticed to be deficient in that aspect of their behaviour? The best answer I have to that is a question that invokes gender difference in the way autism manifests which has been selected for over thousands of generations, and has very grim implications: What point is there in having a generalist who can't do all the general duties, including having enough social perception to stay alive while relatively powerless due to low status?
*I know, I know #notallmen