They are responsible for detecting external stimuli and transmitting this information to the brain and spinal cord.