At its core, gender is about expressing masculinity versus femininity which is normally correlated with birth sex but clearly not in every case. The error we made as a society was to assume that those who did not align with this were somehow deviant or sick instead of belonging to what proved to be a spectrum. However, the education of both sexes became so pervasive that both saw any deviation from the norm as proof there was something deeply wrong with the individual. Hence, for example, biological women were taught to reject males who were not masculine enough to be their mate. This wasn’t their fault as much as the intensity of the message they received from the time they were born.
There are probably biological forces at play here as well where women seek a partner who will provide the best protection as well as offspring just as men choose women who will be the best providers. I do not presume that such a prime directive does not exist.
But at the margins of each set of males and females, are people whose identities are fully or partly reversed and cannot possibly fit the norm. What they do to deal with this has never been more flexible than it is today because of the openness of our societies and the options available. This has been a godsend for many who in the not too distant past saw only lives of despair through an unavoidable and enforced obligation to conform.
In the end, gender identity and birth sex must be decoupled and thought of as sometimes being distinct and separate; not because we want to but because it is reality.