This is very simplified in that we are only considering a person as a single inverted pendulum, albeit a flexible one. It is more correct to look at a double pendulum and to permit varying strategies such as hip, knee, etc, but all that gets way too involved for a post like this.
A person is in balance when his COG falls within his support base (soles of his feet approximately). Ideally, the COG is colinear with the Center of Pressure (COP) of that support, i.e., the resultant of the reaction forces from the floor. If the COP and COG vary enough, the person feels "off balance" and will use one of two mechanisms to correct that: (1) if the COG is within the support area, he can use ankle torque and/or foot shear to move the COP and COG together; (2)2) if the COG is outside the support area, he will use only foot shear to move the COP and COG closer.
Rotating the arms generates a torque that then allows the person to generate an opposing foot shear torque. It is not a terribly effective mechanism and works best when there is only a slight shear force required. One can see newbie ice skaters try this mechanism and fall flat on their keisters when there is insufficient friction (the coefficient of friction for ice is typically less than 0.1) to generate the opposing torque force.
As noted, this is a "quick and dirty" explanation and makes a whole lot of simplifying assumptions, but explains the basics.