how come a shoe can correct posture?

A shoe can correct posture in kids because of the immature foot structure. Exactly, by providing a 3 D corrective insert for an immature foot- meaning that the subtalar joint is not fused into a permanent position - the arch of the foot is held in perfect alignment. Unless there  is structural deformity on a child- like missing bones or having one lower limb longer than the other- the tibia will be forced to be in anatomical position and all the bones that contribute to Q angle will be realigned. This is in turn prevents compensation of collapsed arch so the skeletal structure is kept aligned. Once the subtalar joint fuses- which happens between 8 to 10 years old, this little manipulation becomes irrelevant. Not only that, but the child will not even tolerate the correction because the fusion will prevent any movement into corrected position. I know this explanation is a little more advanced, but this is intended for medical community.