Pain is an unpleasant sensation that alerts one to the presence of obnoxious stimuli or sensations. These stimuli are transferred by sensory neurons to the dorsal root ganglia-spinal cord and finally to the brain. Glial cells in the peripheral nervous system, astrocytes in the brain, dorsal root ganglia, and immune cells all contribute to the development, maintenance, and resolution of pain. Both innate and adaptive immune responses modulate pain perception and behavior. Neutrophils, microglial, and T cell activation, essential components of the innate and adaptive immune responses, can play both excitatory and inhibitory roles and are involved in the transition from acute to chronic pain. Immune responses may also exacerbate pain perception by modulating the function of the cortical-limbic brain regions involved in behavioral and emotional responses. The link between an emotional state and pain perception is larger than what is widely acknowledged. In positive psychological states, perception of pain along with other somatic symptoms decreases, whereas in negative psychological states, these symptoms may worsen. Sex differences in mechanisms of pain perception are not well studied. In this review, we highlight what is known, controversies, and the gaps in this field.