How does the body figure out which side is left and which side is right? I can think of an easy way to break symmetry but it seems harder to consistently know which side is which.
Short answer: at the single cell stage there's a cilium that, spins in a single direction and establishes chirality. People with immotile cilia thus have a 50/50 chance of getting SI, because the developing body chooses randomly.
Either way, the reason a cilium spins in one direction rather than another is that the motor is a molecular machine built out of amino acids, and amino acids are themselves chiral. If you made a person out of amino acids with the opposite chirality, their cilia would go the other way, and their body would be flipped. It's a lovely example of magnifying something up from the molecular to the macroscopic.