It is determined by the level of fluid properly called endolymph) in the labyrinth - a complex set of tubing in the inner ear.
When the sense of balance is disturbed it causes dizziness, disorientation and nausea. Balance can be upset by Meniere's disease, an inner ear infection, by a bad head cold or a sinus infection, or a number of other medical conditions. It can also be temporarily disturbed by rapid and vigorous movement, for example riding on a merry-go-round.
You can temporarily disturb your sense of balance by closing your eyes and turning rapidly in circles five or six times. This starts the fluid swirling in circles inside your ear canal. When you stop turning it takes a few minutes for the fluid to lose momentum, and until then the sense from your inner ear conflicts with the information coming from your vision, causing dizziness and disorientation. Most astronauts find that their sense of balance is impaired when in orbit, because there is not enough gravity to keep the ear's fluid in balance. This causes a form of motion sickness called space sickness.
A rope-dancer or rope-walker is a balance artist, often using a balance beam, see Tightrope walking.