I just realized how incredible it is that we don't have toes growing out of our ears.
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.
They don't so much know where they are as much as they're just interacting with what's there in the way they were made to, which was all put there due to the DNA to function as a whole.
And to be clear, it's all still amazing, just in a different way. Here's Kurzgesagt video that helps explain how these cells "communicate" to do things like put a body together in the right order.
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.
If an embryo decides to split in two, and then sends out the marker that "this is the right side" and it's too close to the other embro, there will be a set of identical twins, but one will have the heart on the right side, appendix on the opposite side etc. This needs to be known if the "mirrored" person has a colonoscopy, since the colon is folded the opposite direction.