> And how often has the latter actually happened?
Often enough to demonstrate that incarcerating males in women's prisons on the basis of self-declared "gender identity" is harmful policy that needs to be removed and cancelled everywhere it's been implemented.
It's worth keeping in mind that the reason we have sex-segregated prisons in the first place is because mixed-sex prisons were so demonstrably harmful to female inmates, who were subjected to physical violence, sexual assault, rape, impregnation by male prisoners.
> In any case, segregation of men and women in sports is a relatively new thing in history, dating back to around 1920-ish when the first bans for women appeared under the guise of "protecting their health / modesty". Plain and simple, men were afraid that women were just as competitive as they were, most sports are skill sports and not brute-strength sports.
You are confusing two separate things here: access to competitive sports, and having a separate female category in competitive sports. The former was denied to women for the same reasons that women were denied access to many aspects of society that men could freely enjoy. Whereas the latter - eliminating male physical advantage from competition - is necessary for fairness and, in the case of contact sports, for safety.
> Where does one want to draw the line?
Evidence-based policy approaches typically draw the line at the male physical advantage of testosterone-driven development.
So for example a male athlete with CAIS (complete insensitivity to androgens) may be permitted to compete in the women's category because testosterone was entirely ineffective from development in utereo onwards.
Whereas a male athlete with 5-ARD (impaired conversion of testosterone to dihydrotestosterone) won't be, as the phenotype of micropenis and less facial hair doesn't eliminate the male physical advantage in sport.