The teen years are often fraught with door-slamming, eye-rolling and seeming insensitivity, even by kids who behaved kindly before. Some parents worry that they're doing something wrong, or that their children will never think of anyone but themselves.

New research shows that biology, not parenting, is to blame.

In adolescence, critical social skills that are needed to feel concern for other people and understand how they think are undergoing major changes. Adolescence has long been known as prime time for developing cognitive skills for self-control, or executive function.

"Cognitive empathy," or the mental ability to take others' perspective, begins rising steadily in girls at age 13, according to a six-year study published recently in Developmental Psychology. But boys don't begin until age 15 to show gains in perspective-taking, which helps in problem-solving and avoiding conflict.

Robert Neubecker (3)

Adolescent males actually show a temporary decline, between ages 13 and 16, in a related skill—affective empathy, or the ability to recognize and respond to others' feelings, according to the study, co-authored by Jolien van der Graaff, a doctoral candidate in the Research Centre Adolescent Development at Utrecht University in the Netherlands. Fortunately, the boys' sensitivity recovers in the late teens. Girls' affective empathy remains relatively high and stable through adolescence.

The riptides are often noticeable to parents. Susan Burkinshaw has tried to cultivate empathy in her two teenage sons, 16 and 18, since they were toddlers, encouraging them to think about others' feelings. Yet one "went through a period in eighth grade where he was just a bear to deal with. He always had an attitude," says Ms. Burkinshaw, of Germantown, Md. "Then as quickly as it came on, it turned back off again."

The findings reflect a major expansion in researchers' understanding of cognitive growth during adolescence, according to a 2012 research review co-authored by Ronald Dahl, a professor of public health at the University of California at Berkeley. Researchers used to believe that both forms of empathy were fully formed during childhood.

Now, it's clear that "the brain regions that support social cognition, which helps us understand and interact with others successfully, continue to change dramatically" in the teens, says Jennifer Pfeifer, an assistant professor of psychology at the University of Oregon in Eugene. Preliminary research in her lab also suggests cognitive empathy rises in teens. The discoveries serve as a new lens for exploring such teen behaviors as bullying and drug abuse.

Kids who develop affective and cognitive empathy form healthy relationships and argue less with their parents, research shows. Perspective-taking continues to be central for adults on the job, helping in designing and selling products and services, building user-friendly devices, and working smoothly with others with diverse viewpoints and backgrounds.

Affective empathy is grounded in the limbic region of the brain, which regulates emotions. This capacity begins developing in infancy when parents respond sensitively to babies' emotions. Children learn to practice empathy by watching their parents and by experiencing it themselves—being treated well by adults who respond warmly to their feelings, says Anthony Wolf, a Longmeadow, Mass., psychologist, author and speaker.

Cognitive empathy arises from a different part of the brain, the medial prefrontal cortex, which continues developing later, through adolescence. But the two are linked; children's affective empathy predicts their level of cognitive empathy as teens, says a forthcoming study by Caspar Van Lissa, a doctoral candidate at Utrecht's adolescent-research center.

Parents can help instill affective empathy by encouraging children to walk in others' shoes. If Ms. Burkinshaw's kids saw a child being teased or treated badly, she asked them, "If that had been you, what would you have wanted your friends to do to help?"

Her 12-year-old daughter Alexandra recently told her that several classmates had hurt another girl's feelings by blocking her from following them on Instagram. "I said, 'What could you do to help her?' " Ms. Burkinshaw says. Alexandra talked with her friends, and another mother also intervened. The girls apologized and invited the victim back into the group.

Robert Neubecker

Adolescents' brains work particularly hard on perspective-taking; teens make heavier use than adults of the medial prefrontal cortex, says Sarah-Jayne Blakemore, a professor of cognitive neuroscience at University College London. That may be because understanding others' viewpoints takes more conscious effort for teens, while it becomes automatic for adults, Dr. Blakemore says. Perspective-taking continues to develop through age 21.

The decline in affective empathy among young teenage boys may spring at least partly from a spurt during puberty in testosterone, sparking a desire for dominance and power, says the study in Developmental Psychology. Boys who were more mature physically showed less empathy than others.

Boys also feel pressure from peers and some adults to "act like a man," which they often define as being detached, tough, funny and strong, says Rosalind Wiseman, Boulder, Colo., author of "Masterminds and Wingmen," a new book about teen boys. They may suppress feelings of empathy so they can join in joking and teasing with peers, she says. "Humor is the social glue among boys, and empathy would be a brake on what they can and cannot joke about." So some kids "stop listening to their gut."

Also, some teens may appear insensitive because they're actually struggling to avoid being overwhelmed by their own feelings of empathy, says Brad Sachs, Columbia, Md., a psychologist, author and speaker. "Teens who seem aloof, hard-hearted or unkind may in reality be quite the opposite."

Fathers seem to play a special role. Teens whose fathers are supportive, who say they feel better after talking over their worries with their dads, are more skilled at perspective-taking, says a 2011 study of 15- to 18-year-old boys in Developmental Psychology.

Yu Oen of Princeton Junction, N.J., encourages his sons Grant, 19, and Sean, 15, to take others' perspective by discussing current events with them—including how the people involved must have felt. After the Boston Marathon bombing, they talked about how a runner who lost her legs must have felt when entering a restaurant where everyone else was wearing shorts.

"You can see their reaction: 'Wow, that is really tough,' " Mr. Oen says. "They feel it: 'What if that had been me?' " Mr. Oen and his wife Shirley "feel it too," he says. "And we take time to talk about these things."

Write to Sue Shellenbarger at sue.shellenbarger@wsj.com