The spinal cord, running almost the full length of the back, carries information between the brain and body, but also carries out other tasks. From the brainstem, where the spinal cord meets the brain, 31 spinal nerves enter the cord. Along its length, it connects with the nerves of the peripheral nervous system (PNS) that run in from the skin, muscles, and joints.
Motor commands from the brain travel from the spine to the muscles and sensory information travels from the sensory tissues — such as the skin — toward the spinal cord and finally up to the brain. The spinal cord contains circuits that control certain reflexive responses, such as the involuntary movement your arm might make if your finger was to touch a flame.
The circuits within the spine can also generate more complex movements such as walking. Even without input from the brain, the spinal nerves can coordinate all of the muscles necessary to walk. For instance, if the brain of a cat is separated from its spine so that its brain has no contact with its body, it will start spontaneously walking when placed on a treadmill. The brain is only required to stop and start the process, or make changes if, for instance, an object appears in your path.