The feet are connected to the hip through the legs. There are three joints, the ankle connects the foot to the lower leg. The knee connects the lower leg to the upper leg, and the hip joint connects the upper leg to the hip.
We simplify the action by focusing on the hip joint, and ignoring any movement by the kneee or by the ankle. This allows us to show the rotation, but not how the weight is shifted from one foot to the other. We shall deal with that in the next chapter on walking.