The lore has by now been recounted many a time: In 2004, Scott and Andrea Swift moved from central Pennsylvania to Nashville so that their 14-year-old daughter, Taylor, could pursue a career in country music. They bought a house on a lake, and Taylor started heading to Music Row after school to work with songwriters.

As Swift’s star rose, something else shifted: her voice. Researchers at the University of Minnesota analyzed recorded interviews with Swift throughout her career and found that after she moved to Tennessee, she picked up a southern accent. She began to pronounce my like “mah” and boom like “bee-oom”—features not typically present in a Pennsylvania accent. Matthew Winn, a co-author of the study, told me that these changes suggest that Swift’s voice subtly altered to fit in with the Nashville scene. “If you sing country music but you talk like someone from New York or Pennsylvania,” Winn said, “people might not take you as seriously.”

A decade or so later, after Swift moved to New York City, her vocal pitch lowered. This happens to most women gradually over the course of their life, but Swift’s pitch dropped more suddenly than one would expect. This time, Winn told me, the change seemed to be motivated by Swift’s desire to be heard, rather than to blend in. In those years, Swift was speaking out about women’s rights and other issues, and Winn speculated that she wanted to come across as authoritative, as people with deeper voices are often perceived. (She might also have considered New Yorkers to be more powerful and serious than southerners, and rumbled accordingly.)

The researchers studied Swift’s voice as a way of exploring a phenomenon called “second-dialect acquisition,” or the way people learn a new style of speaking. Moving from place to place is the most obvious circumstance that might cause someone’s accent to change, but people’s voices can also evolve when they enter into new relationships or start spending time with different groups of people. When it comes to an accent, “the degree of flexibility within a person over the lifespan is a lot greater than we used to think,” Morgan Sonderegger, a linguist at McGill University, told me.

About a decade ago, the predominant thought within linguistics was that people’s speech doesn’t change much after adolescence. But since then, many examples have emerged of people who contradicted this trend. Rather than immutable features, our accents appear to be more like mirrors, reflecting the people we surround ourselves with. Queen Elizabeth II, for instance, changed her accent over time to be more similar to that of her subjects, according to analyses by the University of Munich’s Jonathan Harrington and others. Throughout the early part of the Queen’s reign, Britain underwent significant social change, which meant she began to both interact more with policy makers who had different accents, and hear a wider variety of accents on radio and television. In effect, at various points in her life, the Queen no longer spoke “the Queen’s English.”

Adopting a new accent is mostly a subconscious process. One theory for why it occurs, according to Jennifer Nycz, a linguist at Georgetown University, is that we implicitly adopt the characteristics of others’ speech to bridge social distance and get other people to like us. (In lab experiments, people asked to repeat someone else’s speech will subconsciously shift their own speech style to match what they just heard.) “If you move to a new place where you’re consistently doing these little accommodations in the same direction to a new accent,” Nycz told me, “then after a while some of them will stick.” Another theory holds that it doesn’t matter if we want our new neighbors to like us; we all learn language from the sounds we hear around us, and although this happens most rapidly in early childhood, the process continues into adulthood.

Sometimes, though, accent acquisition is explicit, especially when intelligibility is a concern. Nycz told me that British people in the U.S. will sometimes say water with a vocalized r in restaurants because “watah” can flummox American waiters. Abby Walker, a Virginia Tech linguist who is originally from New Zealand, has started saying tuna when she orders a sandwich in America, because when she says “choona,” as a Kiwi would, she sometimes gets chicken.

Not everyone’s accent changes when they move or enter a new community. (Sonderegger told me he once met a Brit who had lived in Montreal for 40 years, and who, in a still very British accent, told him, “I think I’m one of your non-changers.”) A study that followed 11 people working at an Antarctic research station over the course of about six months found that they did begin to develop the first stages of a “common accent,” including pronouncing goat more like “gut.” But when Sonderegger and his co-authors examined the speech, over several months, of a similarly isolated group—participants on the ninth season of the show Big Brother U.K.—he found that only two of the contestants began to speak more like each other, and that was because they started dating each other. What’s more, some accents are difficult to fully adopt because certain sounds are perceptible only to locals. Nycz told me that Philadelphia has differences in its a sounds that are so specific and fine-grained, you will really learn the proper context for them only if you’re “born in Philadelphia to parents from Philadelphia.”

How much your accent changes in a new environment depends on a few factors, according to researchers I interviewed. First, you’ll develop a stronger accent if you’re younger when you move to the new location. Also important is your social network in the new place—whether you meet lots of locals. I remember vacationing in Italy with some American friends who had moved to Modena. The husband, a born-and-bred midwesterner who worked with Italians all day, gesticulated wildly and slipped in the occasional broken-English “What it means?” Your attitude about the new place also matters. If a proud New Yorker who disdains the West Coast moves to California, he probably won’t adopt a surfer-dude way of speaking.

The relative prestige of the accent also seems to play a role. Some evidence suggests that people more readily pick up accents associated with power and status. Walker told me that many people from Appalachia lose their accent if they face negative comments after leaving the region. And in her research, she found that English people in America seem to hang on to their accent a little more tightly than Americans in the U.K. do. “My accent is a wonderful weapon. Why would I change something that’s working so well?” one of her British study participants asked. Brits in Ohio told Walker they get out of speeding tickets by speaking in their native accent; Americans in London told her that they thought they sounded “stupid.”

Sonderegger said longitudinal studies that have surveyed people over the course of their life suggest that accents follow a U-shaped pattern, in which a person’s voice changes as they enter college or the working world, before gradually reverting to their home accent in old age. The thinking is that, as we launch our careers, we seek to sound professional and to fit in with our colleagues, but in old age, well, we just stop caring as much. Toward the end of her life, Queen Elizabeth began once again to sound more like she did in the 1950s. One study found that Ruth Bader Ginsburg mellowed her distinctive New York accent while arguing cases as a young lawyer, but embraced it again as a Supreme Court justice who had nothing left to prove.

Adopting a second accent might seem similar to code-switching, the process in which a speaker addresses different audiences with a different tone and vocabulary. But code-switching, researchers told me, involves intentionally moving between styles of speaking throughout the day, depending on your audience (for example, using baby talk with your toddler and corporate buzzwords at the office). An accent shift is more all-encompassing and subconscious.