The gender you are assigned at birth is based on genitalia and “biological sex” but it’s largely problematic because genitalia is not always a good indicator of how a person will identify as they grow up. In cases of intersex people where genitalia is ambiguous, doctors will often make arbitrary decisions and do emergency surgery that is often unnecessary and irreversible. So basically a doctor is making a snap judgment based on whether the genitals look more “male” or “female” even though that ignores hormones and differences in chromosomes that some intersex people have. The idea is that you’re “protecting” the child from the stigma of being intersex, but this often leads to that person not identifying with the gender they were assigned. Besides, the existence of trans people should be enough proof that assigning gender based on whether you have a penis or a vagina is super limiting and cissexist. Gender is not a binary, but encompasses a whole spectrum of identities. It’s also something we socially constructed to align with genitalia but honestly the two don’t necessarily overlap and it’s a very limited and problematic system. Anyway, I’m sure some of my trans or intersex followers could explain this much better than me.