The somatic nervous system carries motor commands to skeletal muscles and sensory input from skin and joints. The autonomic nervous system (sympathetic and parasympathetic divisions) innervates visceral organs. Sympathetic fibers emerge from the thoracolumbar spinal cord and promote 'fight-or-flight' responses. Parasympathetic fibers emerge from the brainstem and sacral cord and promote 'rest-and-digest' responses.
From your study of the spinal cord and peripheral nerves, you know that spinal nerves arise from the cord via dorsal (sensory) and ventral (motor) roots, and that peripheral nerves carry both afferent signals from the body to the CNS and efferent signals back out. The peripheral nervous system divides into two fundamental streams based on what those efferent signals control: the somatic nervous system, which governs voluntary movement, and the autonomic nervous system (ANS), which governs the involuntary control of internal organs. Understanding this division is really about understanding two different kinds of motor output: one that reaches skeletal muscle through a single motor neuron, and one that reaches smooth muscle, cardiac muscle, and glands through a two-neuron chain.
The somatic nervous system is the simpler of the two. A single lower motor neuron runs continuously from the ventral horn of the spinal cord (or from a cranial nerve nucleus) all the way to its target skeletal muscle. When you decide to move your arm, a signal travels down this unbroken chain and triggers muscle contraction. The neurotransmitter is acetylcholine, acting on nicotinic receptors at the neuromuscular junction. Sensory information — touch, pressure, vibration, joint position — travels back the other direction through sensory neurons whose cell bodies sit in dorsal root ganglia. The somatic system keeps you connected to and in control of your body surface and musculoskeletal apparatus.
The autonomic nervous system is organized differently. Instead of a single neuron from cord to target, there are always two neurons in series: a preganglionic neuron that originates in the CNS and a postganglionic neuron that originates in a peripheral ganglion and reaches the target organ. The two divisions of the ANS differ in where these preganglionic neurons originate and how the system responds. The sympathetic division has preganglionic neurons in the thoracic and lumbar spinal cord (T1–L2, the "thoracolumbar" outflow). These neurons synapse in ganglia close to the spinal cord (the sympathetic chain), so postganglionic fibers are long. Sympathetic activation prepares the body for rapid action: heart rate and blood pressure rise, bronchioles dilate, blood is redirected to skeletal muscle, and digestion slows. The neurotransmitter at the target organ is predominantly norepinephrine (except at sweat glands, which use acetylcholine).
The parasympathetic division has preganglionic neurons in the brainstem (carried by cranial nerves III, VII, IX, and X) and in the sacral spinal cord (S2–S4, the "craniosacral" outflow). Because these fibers travel far before synapsing in ganglia located near or within target organs, postganglionic fibers are short. The parasympathetic system promotes conservation and restoration: heart rate slows, digestive activity increases, glands secrete, and smooth muscle in the gut and bladder contracts. The neurotransmitter at the target organ is acetylcholine, acting on muscarinic receptors. Most organs receive dual innervation from both divisions, and their resting function reflects the balance between opposing inputs — a principle of physiological control that will recur throughout your study of organ systems.