According to About.com, the gluteus medius muscle is responsible for movement of the thigh laterally away from the centerline of the body; this is referred to as abduction. The gluteus medius is also responsible for the ability to twist the leg around its own axis.
About.com explains that the gluteus medius is very active in balancing the body when in movement. It works constantly to maintain a level posture for the pelvis, thereby preventing the body from tumbling over when walking or running. When a person stands on one leg, it is the gluteus medius that causes the leg to twitch in order to maintain balance.