The circumstances have reversed, the participants have changed places, as in I was one of his research assistants, subject to his orders, but now that I'm his department head the shoe is on the other foot. This metaphoric term first appeared in the mid-1800s as the boot is on the other leg. Literally wearing the right shoe on the left foot would be quite uncomfortable, and this notion is implied in this idiom, which suggests that changing places is not equally beneficial to both parties.
The American Heritage® Idioms Dictionary Copyright © 2002, 2001, 1995 by Houghton Mifflin Harcourt Publishing Company. Published by Houghton Mifflin Harcourt Publishing Company.