The autonomic nervous system functions to accomplish homeostasis, which means maintenance of critical physiological parameters of the internal environment within limits that are compatible with life.
The autonomic nervous system is part of the peripheral nervous system. A diagram of the general case is seen below:
Features of the ANS include two motor neurons in series from the CNS to peripheral structures. The 1st motor neuron is in the brain or spinal cord, and its fiber is called the preganglionic axon. The second motor neuron is in a peripheral ganglia, and its axon is called the postanglionic fiber. Paravetebral ganglia are located in the sympathetic trunk. Prevertebral ganglia are in the abdominal region. Terminal ganglia are on the organ of innervation, such as heart, lung, stomach, bladder, etc. Head ganglia are in the head, close to the structures (eye, salivary glands, etc).
A diagram detailing the origins of the autonomic nervous system in the CNS and the sites of its peripheral ganglia for the sympathetic and parasympathetic divisions is seen below: