Do you find it impossible that one's genitalia
could be inconsistent with one's brain?
So glad you had the good sense to ask that question. It's strange that it seems so obvious to me and others, while many simply cannot grasp even the concept.
Research suggests that gender identity is likely influenced by a combination of biological, genetic, hormonal, and environmental factors, while assigned sex at birth is the responsibility of nothing but the hormones (testosterone, estrogen) present or absence during development. The brain and body do not develop at the same pace, and short-term hormonal or other disruptions may affect brain development, and then resolve, having no effect on sexual development of the body.
The brain plays a crucial role in shaping one's sense of gender identity, and studies have identified structural and functional differences in the brains of transgender individuals compared to cisgender individuals. However, the exact mechanisms and causes are still not fully understood.