Transsexuality is defined as inconsistency between one's gender identity and one's assigned sex. I know a couple of of people who are transsexuals but I'm no expert in this matter at all.
The basic biological definition of sex is quite simple. Females produce a small number of large gametes and males produce a large number of small gametes. Humans are mammals.
So how can there be any lack of clarity in any individual's case which sex they are?
Nature isn't that cut and dried in reality. If you look at all primary and secondary sexual characteristics, which are physical and mental, and how they develop from conception when the embryo receives its chromosomes until adulthood, it becomes clear that the process is very complicated and involves both biological and environmental factors. It should not surprise anyone that while in the vast majority of individuals their primary and secondary sexual characteristics align, there will be aberrations and inconsistencies in a small number of cases.
Based on what I've been told transsexuality can be a confusing and difficult thing to process in itself. That can be made much worse by social attitudes. Even in fairly progressive countries a lot of people for whom homosexuality is no problem at all tend to have a negative attitude toward transsexuals. That the majority struggles to process transsexuality constructively, encourages forms of discrimination and violence toward transsexuals that were commonplace toward homosexuals a generation or two ago.