“You’re welcome” took up its new function as an expression of rudeness at just the moment when the phrase lost its usefulness as a nicety. On social media, where even the most casual interactions often unfold as rapid-fire textual ­exchanges, traditional conversational etiquette no longer applies. The acts of giving compliments and sending thanks have been con­verted into mechanical processes, in which appreciation is demonstrated in the favoriting of a tweet or the liking of a Facebook post, then rendered in graphic form — a tiny yellow star, a diminutive thumbs up. Twitter recently fiddled with its software so that every time you favorite ­another person’s tweet, the system rewards you with an animated exploding star.

But while we’re encouraged by Twitter and Facebook to shower strangers with approval, those platforms have also heightened the transactional properties of compliments. It may seem selfless to tweet praise or congratulations to another person, until your niceness is rewarded with retweets and favorites that serve to raise your own profile. Self-­promotion is so ingrained in the design of social networks that even a gesture of thanks can come off as narcissistic. A few months ago, a young novelist I follow won a prestigious award, and congratulations rolled in from all corners of literary Twitter. She thanked everyone with a personal tweet, blurring the distinction between gracious and smarmy. What was once considered a polite reflex now draws attention to just how much praise you’ve received.

To trace the pop-culture origins of courtesy’s sharpened edge, head back to high school. The comedians who seized on the arrogance of “you’re welcome” are overwhelmingly male, as are the tech entrepreneurs molding the new rules of conversation. But the social insights that inform their work belong to teenage girls, who have always been attuned to the minutiae of verbal power struggles. “Picture what happens when one girl tells another girl how great she looks,” Rosalind Wiseman writes in her pop-anthropological study of adolescent girls, “Queen Bees and Wannabes.” “Does the recipient of the compliment thank her? Rarely. Instead, the response is usually some variation of ‘Oh, no, I look so fat and horrible. I can’t believe you would say that. You look so much better than me.’ Girls must degrade themselves after being complimented in order to not appear vain.”

In girl world, thanks are so taboo that “you’re welcome” doesn’t even come up. Consider this exchange from “Mean Girls,” Tina Fey’s 2004 satire based on Wiseman’s book, between the queen bee, Regina George (Rachel McAdams), and the new girl, Cady Heron (Lindsay Lohan):

REGINA: “You’re, like, really pretty.” CADY: “Thank you.” REGINA: “So you agree.” CADY: “What?” REGINA: “You think you’re really pretty.” CADY: “Oh, I don’t know.”

Ten years ago, Fey intuited that among girls, even the most banal conversational exchanges could be wielded as weapons. Regina is so studied in the art of verbal manipulation that every compliment she gives is a sneaky bid to amass more social capital: “I love your skirt,” she shouts to a girl passing in the hall; “that is the ugliest effing skirt I have ever seen,” she snarks once her target is out of earshot. Online, we are all Regina George — projecting niceness on Twitter, carefully self-deprecating in front of our followers, then getting rude in private Gchat conversations with trusted friends. It’s easy to dismiss this verbal shift as passive-aggressive and petty, but it is also secretly brilliant: At this moment, the power to shape conversation is in the hands of subtly perceptive girls. You’re welcome, America.