Important differences in biology exist at every level of description, from molecular pathways to large scale brain morphology, and yet! The differences by sex are often subtle, and heterogenous, and not consistent across species. Nevertheless, while the sex chromosomes have far-reaching effects on development, starting at the very beginning of the neurodevelopmental timeline of cell proliferation and migration, the formation and structure of synapses, and so on, its not the whole story.
A too common way people differentiate sex from gender is to say that there is, on the one hand, biological sex, which they’ll add is both real, binary, and unchangeable, and then there is gender, the infinitely mind-bending social construct. This framework is often draped with an aura of scientific impartiality. I want to stress to you that this framework is not scientifically justified. Not at all. Further it is patently harmful and trivialized the very real phenomenon of gender diversity.
First, biological sex is not the same thing as chromosomal sex. The sex chromosomes only partially, and only indirectly influence physiological and brain development. Development is fundamentally a multilevel process integrating genetic, epigenetic, environmental, and experiential factors, all of which can lead to qualitative and quantitative differences in the expression of the sex phenotype. Differences in the timing and dosage of steroid exposures within an individual, can lead to any particular feature being more stereotypically masculine, feminine, androgenous, or other phenotype altogether. The result is a mosaic of features with high degree of overlap in those with XX and XY chromosomes.
Sometimes this kind of effect pushes someone's actual attributes to be not as typical of their chromosomal sex. These traits in turn will influence the gender identity they feel most in tune with, and how they incorporate and react to the socialization of gender norms.