Sociolinguistics is, broadly speaking, the study of how language interacts with society. I’m going to give an anecdote that demonstrates that interaction. In famous sociolinguist William Labov's book Sociolinguistic Patterns, Labov describes a study he did in the 1970s on the dialect of Martha’s Vineyard. He found that people who exhibited the dialect most strongly were middle-aged, around 30 to 45. The reason for this is that this was the first generation for whom living permanently on Martha’s Vineyard was becoming less economically viable because of tourists and the like, so staying on the island was a very deliberate choice for them. Those who stayed despite the economic struggles were the people who identified most strongly with the Vineyard, and so were also the ones with the thickest accents. Conversely, among the Portuguese immigrant population on the island, the people with the thickest accents were the youngest generation, because they were the first generation to feel truly accepted by the islanders.
Note: The researchers measured accent thickness by measuring the centralization of two diphthongs. Basically, higher numbers mean a thicker accent.