Spacecraft (which most roboticists would call robots) typically orient themselves using a combination of reaction wheels, magnetic torquers and thrusters. The reaction wheels spin rotate the aircraft by “taking” angular momentum into their own rotation. They don’t require a local magnetic field or the expenditure of fuel, so are a nice choice.
Tons of different implementations out there for balancing. Maybe the most common one is the one we humans use, which requires zero wheels :)
And beyond the muscle mechanics, do we understand what the brain is doing? For example, I find it fascinating that I cannot balance myself on one foot if I close my eyes. So obviously we use some visual cues to balance.
Skill issue. I'm good at balance sports and can say that balancing on one foot with closed eyes is hard but doable. Just train it :)
Sensors, brain, muscle movement.
https://eu.mouser.com/ProductDetail/TDK-InvenSense/ICM-20948...