The interneurons constitute one of the three basic classes of neurons. They receive input only from neurons, either sensory neurons or other interneurons, and they output only to other neurons, which may be other interneurons, sensory neurons, or motor neurons. That distinguishes them from sensory (afferent) neurons, which have sensor cells as input, and motor (efferent) neurons, which output to muscle, glands or other tissues that produce some effect within the body or in the environment.
Interneurons make up all of the brain and most of the spinal cord, and number close to a hundred billion by some estimates. They are not all identical. The interneurons that make up the brain's cerebral cortex alone include pyramidal, spiny stellate, chandelier,and basket neurons, and perhaps hundreds of other kinds. (100 billion is like how many stars there are in the Milky Way or something.) It is the fantastically complex network of interneurons and their specialization into morphologically distinct areas within the brain and other parts of the central nervous system, such as the cerebrum, the thalamus, the cerebellum, the brainstem and various nerve plexuses around the body that allow for truly complex and intelligent behavior. Even the simplest of neural behavior, the reflex arc, involves at least one interneuron that connects an afferent neuron to an efferent neuron. Our knee-jerk reflex, more formally known as the patellar reflex, is an example of a reflex arc in which a single interneuron in the spinal cord links a sensory neuron to a motor neuron.