The process is always this: some early 20th century dude finds a behaviorally similar groups of weird kids, a post ww2 "geneticist" or brain scan enthusiast find some in between, shared markers, they double down and zero in on that particular subset of the former behaviorally defined group and redefine the behavioral "symptoms" and then do away (for economic reasons) with the hard science tools and go by behavior again and then end up with a completely synthetic, over -or underdiagnosed "disorder".
I'd also point out another factor, which I mentioned in another thread before- it links in with Paulo Freire's
Pedagogy of the Oppressed (oppressed people must play a key role in their own liberation, teachers should not see students as passive receptacles of their knowledge but instead have dialogue with them) to Robert Alford, Mike Oliver and the Union of the Physically Impaired against Segregation's work creating an emancipatory model of disability (disability is not the same as impairment; disabled people should be understood as a class oppressed by a society rather than just people suffering a medical condition; disability is a social construction). The role patient advocacy has played in the shift we've seen cannot be understated.
The conventional approach to medicine is basically that "this person has something wrong with them, the doctor will identify what it is and therefore treat them accordingly". Since the latter half of the 20th century this has been undermined. It's not necessarily a bad thing, as it has helped rebalance the scales away from malpractice, but TRAs and neurodiversity activists have this in common. The gold standard of autism treatment has been Applied Behavioural Analysis, which is basically trying to get autistic people to recognise when they're being autistic about something and teaching them to knock it off,
historically using aversives (reinforcing it through punishment like yelling at them and smacking them, or even electrocuting them) and also dosing them up with antipsychotics.
They don't do that any more, which is good (since, generally speaking, most people agree that electrocuting children is a bad thing) and the shift has been to using rewards as a motivator. But the neurodiversity movement argues that ABA can be stigmatising and pathologising so e.g. trying to get an autistic kid to stop stimming by rocking back and forth in their chair is harmful. Consequently autism has started shifting from "problem to be treated" to "natural variation that people should accomodate". And again, I don't completely disagree with that approach but I'm sure we've all encountered the people who take it to extremes ("Why did you fail to attend this meeting?" "I'm neurodiverse! You should accept I'm going to miss meetings sometimes!").
And since the neurodiversity movement argues for removing barriers and self advocacy, and since autism no longer involves getting smacked about for talking about trains but instead validates you as special and different and someone that people need to make accommodations for, it's created a situation where people are actively motivated to doctor shop for an autism diagnosis. I'm sure you can see the parallel with gender dysphoria as a condition the doctor treats to a declarative identity that should be affirmed and accomodated.