They don't. You cannot change sex. Have you seen the results of bottom surgery, in either sex? The best you can do is a parody-like approximation of outdated gender stereotypes.
The topic is getting muddled.
You're equating genitalia with gender. The younger generation has redefined gender expression in a non-binary way. The question of surgeries, hormone therapy and "detransitioning" is a different topic.
If you're asking how a medical person views "gender", we now collect gender as "birth gender" which is more in line with the results of genetic testing, we collect a legal gender which would be in line with what would be on a government ID and we collect a gender identity which is how the patient chooses to express their gender.
It actually is. Studies have shown that when children with gender dysphoria receive no puberty blockers, no HRT and no surgeries, 95-98% grow out of it during puberty. Puberty is awkward, but it's also what helps us develop our brain, understand complex issues and accept our own adult bodies.
You might want to re-read the research.
The research is still evolving but one of the patterns that is becoming more apparent is that there's a difference between gender dysphoria in children vs adolescents/adults. Children who show signs of gender dysphoria (which is still the DSM-5 TR diagnosis) are more likely to "outgrow" the condition. On the other hand, when gender dysphoria is diagnosed in adolescents and adults, it is less like to change. There's a question on the table as to whether the DSM diagnosis of gender dysphoria should be used in children because it is more likely to be a transitional stage of development that may not continue into adolescence.
The diagnosis of "gender dysphoria" is about how the patient is coping with an incongruence between their gender identity and the gender that they were assigned at birth. A patient who wants to express a different gender is not considered a mental health issue. When a patient is having conflict or distress over an incongruent gender identity issue, then that is when the diagnosis of "gender dysphoria" comes into play.
What is problematic about many of the current treatment programs is that they are lacking mental health involvement in treatment. Until recently, "gender dysphoria" wasn't "fixed" with an endocrine or surgical solution until all mental health options were explored.
The original gender treatment programs from the 1990s focused primarily on adult mental health counseling. The outcome of the counseling
might involve referral to endocrinology for hormone treatment or to a surgical specialty. The research studies that are being cited in this thread are programs that did not include adequate mental health evaluation and counseling, which is something that the UK and European programs have mentioned in their re-evaluation of their current gender dysphoria programs. The recommendations that are coming out of those studies is that "fast-track" treatment programs need to be reconfigured to be more in line with earlier programs that began with mental health evaluation and referral. Another recommendation is that there needs to be different treatment protocols for children vs adolescence/adults which is aligned with the research that shows that gender dysphoria in children is more likely to be a transitory condition.
TLDR: Recommendations coming out of research studies are changing the current treatment for gender programs. Treatment with hormone therapy or with surgical intervention is rarely appropriate for children. For adolescents and adults, mental health evaluation should be the primary treatment for a diagnosis of gender dysphoria and any referral for hormone therapy (endocrinology) or surgery should only occur after mental health evaluation and treatment.