X chromosome inactivation in neurodevelopmental diseases
In mammalian systems (humans here), the female has two X chromosomes, while the male has one - the X chromosome is not only necessary for sexual dimorphism, but also has protein coding genes important in neurodevelopment and functioning. As a form of dosage compensation to prevent overproduction of these proteins in females, one of the X chromosomes is randomly inactivated independently in all cells in early mammalian development (8 cell stage) . This leads to mosaicism in females, which leads to greater genetic variability in females, as well as potential heterozygote advantage.
Skewing and escape genes
XCI is more nuanced than just randomly inactivating an X chromosome in each cell independently, though. While one would expect a rough 50/50 split of maternal and paternal X chromosomes throughout the body, it is not always the case - especially when one of the X chromosomes may make the cell less viable. In that case, we find a skew, where, 75-80% of the body inactivates the same X chromosome.
In parallel, XCI is not competely black and white - since the XIST complex spreads like a blanket around the inactivated X chromosome, some areas are left exposed - they escape XCI. These escape genes are expressed from both X chromosomes. This means females inherently have a higher dosage of these specific gene products than males, contributing to some amount of sexual dimorphism.