You may recall that the spine is a column of mostly bone, with some cartilage and ligaments filling the spaces between. In a side view, it curves forward and back twice along its length, which improves its flexibility. The human spine consists of 32-34 squat bone cylinders called vertebrae, which are usually divided in textbooks into five segments. Top down, they are the cervical (neck), thoracic (chest), lumbar, sacral, and coccygeal (tailbone) sections of the spine. The first four segments have the same number of vertebrae in all humans (barring certain rare conditions): 7 cervical, 12 thoracic, and 5 each lumbar and sacral. The coccyx (tailbone) is the vestigial remnant of a tail and consists of 3-5 (but usually 4) partially-fused vertebrae.
Healthy sitting mostly deals with the lumbar spine, which is the least mobile of the segments and carries the most gravitational weight when seated.
To gain a better understanding of how painful conditions arise from poor spinal posture, a degree of anatomical and physiological knowledge is necessary. In the simplest terms, the vertebrae – which are solid bone – are the load-bearing “frame” of the spine. Vertebrae have a roughly circular lumen (hole) near the center; these align one under the other to form the spinal canal, essentially an “armored” duct for the spinal cord. The spinal cord in turn is a bundle that collects most of the nerves in the body on their way to the brain, and thus a vital system. The vertebrae do not sit directly on top of one another, as bone is hard and brittle and such a structure wouldn't be able to bend at all. Instead, the spaces between them are filled with slices of cartilage, shaped similarly to the vertebrae but thinner, called the spinal discii (or just “discs”). Simply put, stressing the spine leads to deformation of the relatively soft discs, which usually causes misalignment of the lumen (holes), thereby narrowing the spinal canal. If severe enough, some of the nerves forming the spinal cord (or branching away from it through smaller “side holes” present at each vertebra) can get pinched, leading to sometimes severe pain.
While back pain can be caused by simple mechanical overloading, which is extremely common and generally reversible with rest and improved posture, it is also possible that the cause is a displaced spinal disc, a more serious condition requiring professional treatment. In any event, if you suffer from long-term back pain, particularly pain that does not appear linked to acute overloading, it is recommended to see a physical therapist or chiropractor. They will either be able to help you get rid of the problem, or will be able to recognize that it requires seeing a physician.