What’s the difference between catchy and annoying? Anyone who spends the next hour in agony after reading the following words—”Itsy Bitsy Teeny Weeny Yellow Polka Dot Bikini“—will tell you that, when it comes to the infectious potential of melody, there doesn’t have to be any difference at all. We tend to think of pop hitmakers as technicians of pleasure, Wonka-like shaman-confectioners spinning up cotton candy. But some are masters of darker, crueler arts: There can be an element of torture—of pain meted out to a precise degree—to the most enduring pop songcraft. We hear this anytime anyone howls, “I can’t get this goddamned song out of my head!”

On the list of pop-songwriting priorities, getting a goddamned song into as many heads as possible is tops. And while some songs sneak in and catch us unawares, others harangue their way down our ear canals, clawing and scraping as they go. “Ob-La-Di, Ob-La-Da,” “Kokomo,” “Never Gonna Give You Up,” and “My Humps” are among those that take this second route, and so is every hit released thus far by 23-year-old Kesha Sebert. Better known as Ke$ha, she is the latest pop figure to embrace irritation as an-all-but-explicit strategy for attaining pop dominance. The chorus to her single “Take It Off” is built around the needling, snake-charmer melody of “There’s a Place in France,” but that’s just the beginning of her catchy-annoying offensive. Ke$ha is a deeply polarizing figure and, at least according to the old show-biz rule that it’s better to be abhorred than ignored, she’s doing everything right: Most pop hopefuls would kill for half of her haters.

Late last month, she released Cannibal, a nine-track follow-up to her debut album, Animal, which has sold 2 million copies since its release last January. Like the album, the EP sits in that sweet-and-sour spot where catchy and annoying become one. The music is masterminded by the producer Lukasz “Dr. Luke” Gottwald, who had a major hand in Kelly Clarkson’s “Since U Been Gone,” Katy Perry’s “I Kissed a Girl” and “California Gurls,” Miley Cyrus’ “Party in the U.S.A.,” Flo Rida’s “Right Round,” Taio Cruz’s “Dynamite,” and the bulk of Animal, including its first single, “Tik Tok,” which was America’s most popular song for nine weeks straight. Gottwald falls for the most part into the technician-of-pleasure column. As with a P.G. Wodehouse story or an episode of Pinky and the Brain, the fun of listening to a Dr. Luke song is the fun of witnessing a formula perfected and, with pleasing modifications here and there, rolled out over and over. He likes his songs self-reflexive and, after a fashion, interactive: Several feature big fun singalongs about the big fun of listening to his songs. They are shiny with a faint patina of poignancy, and spring-loaded, building tension over fleet, throbbing verses, bursting into cathartic half notes and whole notes on the choruses, tamping the energy down only to explode again, and so on till some show-closing payoff—one of my favorites is the ecstatically screeching sax solo on Katy Perry’s “Last Friday Night,” which nods to Gottwald’s ‘90s stint as a member of the Saturday Night Live house band (he played guitar), and is the closest thing to a risk you’re likely to hear in his songwriting.

It’s hard to pinpoint exactly where Gottwald turns the corner into torture with Ke$ha. In a sense, the catchy-annoying division of labor is split evenly between them: He supplies the former, she supplies the latter. But his hands aren’t totally clean. He favors two tricks when it comes to his protégée: simple synthesizer riffs meant to evoke the bright, primitive melodies of 16-bit-and-under videogames (which underscore the sense that Ke$ha is an outsize screwball, half-human and half-cartoon), and hyper-stuttering, recklessly pitch-corrected vocal effects that can make T-Pain sound like a bluesman by comparison. On songs like “Tik Tok” and the new “We R Who We R,” the nostalgia-warmed bleep-bloops of the Atari era mingle with the dystopian digi-warbles of the cold, AutoTuned now.

AutoTune, in Ke$ha’s case, seems more ornamental than corrective: She has a strong, sneering vibrato, glancingly reminiscent of Alanis Morissette and excellent at communicating both rapture and recrimination. But it’s what Ke$ha does badly, not what she does well, that makes her distinct: She raps, with such groaner-stuffed gusto that this has become her trademark, her way of sticking out not just in radio playlists but in the (only slightly smaller) Gottwaldverse, populated as it is by a legion of sassy young mamas with pipes.

With Ke$ha, one is tempted to put “rap” in quotation marks, not out of snarky disdain but because she treats rapping as, at best, a rough idea: She seems as interested in discordance as in rhyme, if not more so. Even a first-rate phoneme-mangler like Lil Wayne would have difficulty joining the words “CDs/parties/tipsy” sonorously. On “Tik Tok,” Ke$ha doesn’t even try, her bubbly, enunciated phrasing emphasizing, rather, that these words don’t belong together.

There’s also the matter of what she raps. A boast: “We make the hipsters fall in love/When we’ve got our hot pants on and up.” A confession: “My steez is gonna be affected/If I keep it up like a lovesick crackhead.” A punchline: “I just can’t date a dude with a vag.” These lyrics land with a piercing clang, but that’s part of the point—they clang and keep on reverberating long after the songs finish. I summoned all three from memory with alarming ease and accuracy.

Ke$ha’s catchy-annoying masterstroke, though, is that she’s annoying not because she recognizes the rich capacity for masochism in the listening public (though it may have occurred to her), but in the service of an in-your-face, immature, proudly unpolished persona—the girl who laughingly pees in public, scorns “backstabber” frenemies, and rebuffs rich snobs. This helps her transcend novelty status: She isn’t only catchy-annoying, she’s relatable-catchy-annoying, turning obnoxiousness into a badge of I-don’t-care-what-you-think defiance and (the blatant artifice of the pose notwithstanding) an aura of endearing outsiderishness. That some of us do not find Ke$ha relatable or endearing isn’t her problem. She speaks directly to a core audience of teenage girls and drunk people—the two demographics no pop star can survive without.

Like Slate on Facebook. Follow us on Twitter.