AFAIK it all boils down to the fact that during embryonal development our cells, which at that point were just a blob of undifferentiated autonomous chemical machines, somehow managed to unanimously agree upon the cardinal directions (up-down, left-right, front-back) for future development - and thanks to this, we don’t have toes growing out of our ears.
I mean, that’s what dna is for. These machines aren’t operating blindly (or even “cooperating” or agreeing on anything, really). They’re following the code that makes up who we are.
Someone was probably born with toes on their head in the past and life didn’t go so well that they could have children that also survived. This is why our DNA doesn’t have instructions for growing toes on our head.
Those who don’t usually don’t make it far.
In science that is called symmetry breaking (going from a homogeneous blob to left right something) and a very active topic of Research.