The rate at which someone strokes your hair can cause feelings of pleasure or annoyance — too slow is repulsive, too fast is annoying, and just right soothes.

There's a scientific explanation for this: People have special nerve endings (wrapped around the base of hair follicles) that detect the deflection of the hairs.

"In turns out, remarkably ... that hairy skin has a special caress sensor," neuroscientist David Linden tells Fresh Air's Terry Gross. "If you actually record electrical nerve endings long before they get to the brain, they send more signals to the caresses that feel the best."

In Touch, his latest book, Linden writes about this and the "weird, complex and often counterintuitive system" of touch circuits involving the skin, nerves and brain that create pleasure and pain.

The two sensations are inextricably linked, Linden explains.

"Part of what we know is that when pain ends, that is pleasurable," he says. "Think of taking off your ski boots after a day of skiing — it feels really good. But there's something more complicated than that: What I think it is, is that both pain and pleasure are emotionally salient. They mark experiences that are important for your life and, in terms of memory, they're the signal that says, 'This is important; write this down and underline it. Don't forget it.' "

So what else can be emotionally salient? Chili peppers.

"They're a bit painful," Linden says. "Why should we want to put something painful in our food? I think it is because it is rewarding to eat something that is a little bit of a threat."

SeparatorInterview HighlightsOn why life without touch is so problematic

Touch is so central to our humanity that it's hard to even imagine [life without] it. For example, if a child is born blind, they can grow up and have a completely full and normal life. They will be cognitively normal, psychiatrically normal and not have profound problems — the same if a child is born deaf. However, if a child is born into a situation, like a Kurd in Romanian orphanages in the 1980s and '90s, where social touch is deprived because there are not enough caregivers around, then that child will develop terrible psychiatric problems, attachment disorders, mood disorders, and also physical problems — problems with the digestive system and immune system, higher incidences of diabetes. And, amazingly, these problems are not just problems of childhood, but persist throughout life.

On how pain can actually protect people

There are a number of different relatively rare cases where you can lose different aspects of touch, and one of them ... is called "congenital insensitivity to pain." Folks who have this inherited syndrome — if they whack themselves on the thumb with a hammer — they'll feel the pressure and the thumb will swell up, but they won't feel any pain at all.

There's a famous case of a boy in Pakistan who jumped off of a high roof to impress his friends. He hit the ground, got up and said, "I feel fine," and he went home and he promptly died because he had no pain to realize that he had broken bones and sustained massive internal injury.

So we think, "Oh great, a life without pain! That would be idyllic!" But if you don't have pain, then you don't have the protective reactions that are so crucial.

On why a caress against the grain of hair can feel strange

There are sensors that wrap around the base of the hair follicles that only wrap around one half of the base. If you looked in a microscope, you would see that they don't make a full 360-degree circle; they cover about 180 degrees of the base. And that means that they are tuned to detect deflection in one direction versus the other.

When we think about the way we speak in our lives, if we had interaction with someone we might say, "He or she rubs me the wrong way." Someone who is socially clumsy we call "tactless" — literally they lack touch. I think it's important — it's telling us something that so many of our common expressions in English refer to the tactile sense.

On why fingertips are so sensitive

Fingertips are endowed with a number of different sensors for mechanical stimuli. There's one sensor called a "Merkel ending," which is good for feeling texture and fine little bumps.

There's a different one that is good for vibration. So if you are driving your car and there are subtle vibrations that come from the road up through your tires up through the steering, through the wheel that you use to detect how slick the road is ... or what the texture of it is — if it's pebbly or smooth — that is being detected by what are called "Pacinian sensors" in your fingertips and in the palms of your hands.

On why you can't read Braille with your genitals

The key point is that the word "sensitive" is really too broad. So it can mean two different things: areas like the fingertips and the lips and the tongue not only can respond to tiny deflections, but they can precisely localize fine special features on objects or sense textures, the sort of thing you would need to read Braille.

Other parts of the body, like the cornea of the eye or the tip of the clitoris or the tip of the penis are very sensitive in the sense that they can detect very fine deflections of the skin, but they're not very discriminative. They lack the Merkel-type nerve ending. And, as a consequence, it will fail if you attempt to read Braille with your genitals.

On the connection between anxiety and pain

We don't entirely understand why depression leads to chronic pain, but it's part of a larger phenomenon in which pain perception is modulated by all kinds of situational factors having to do with mood and expectancy and surprise.

Copyright 2016 Fresh Air. To see more, visit http://www.npr.org/programs/fresh-air/">Fresh Air.