The ear maintains equilibrium by detecting the motion and position of the body.
Motion of the body is detected by the semicircular canals of the ear that are found on the top of the inner ear. The canals are filled with a fluid called endolymph. At the end of the canals, there are hair cells. The movement of the fluid in the canals lags compared to the movement of our bodies. This results in a relative motion between the walls of the canals and the endolymph. This causes the hair cells to move. As the hair cells move, messages are sent to the brain. In this way, the brain is then able to detect movement.
The sacculus and utriculus are other parts of the ear that play a part in maintaining equilibrium. The sacculus and utriculus are interconnected fluid-filled chambers found just above the cochlea. There are hair cells inside each chamber. Attached to the hair cells are tiny spheres of calcium carbonate called ear stones. As the head moves, the ear stones move. The movement of the ear stones initiate an action potential that is sent to the brain. In this way, we are able to detect the orientation of our bodies.