Apparently, J. K. Rowling thinks a lot about sex. Genitalia, masturbation, pedophilia, incest, rape, teen pregnancy — these are all peccadillos that delight her fancy. Now, after decades of writing magical children’s stories, her pent-up prurience can finally break free; the reader is treated to such phrases as “pink labia pulled wide to show dark gaping slits” and “Lots of pushing to get in properly. It’s tighter than I thought.”

There seems to be a formula for reviews of J. K. Rowling’s new book, “The Casual Vacancy.” They start out warning readers that the new book is quite different from the deservedly celebrated Harry Potter series — you’re not in Hogwarts any more. They drop hints about the titillating and disturbing content, and then they transition to calling the book slow-moving, one-dimensional and transparently political. Some reviewers accept this, claiming to have unearthed hidden merit, while others outright dismiss it, damning Rowling’s attempt to transition to adult literature.

Each of these interpretations is as correct as it is oversimplified. “The Casual Vacancy” will not achieve anywhere near the same success as the Harry Potter books, nor will it be a failure. True, Rowling seems to dwell a little bit on the gritty and grotesque details of sex, drugs and poverty, but she is attempting to break out of a niche. The Harry Potter books were phenomenal in the original sense of the word — a miraculous and stunning occurrence — a revelation that taught a generation to love reading. Rowling can’t possibly beat that, and she isn’t trying. Instead, she is doing her best to build for herself a post-Potter career. (And if that entails slipping in a few too many graphic details, then so be it.)

“The Casual Vacancy” begins with the sudden death of Barry Fairbrother, a parish councilman in the little village of Pagford. This seemingly small tragedy in a small town ignites warfare of the most vicious variety. Three men decide to run to fill the “casual vacancy” (an opening created by an unexpected death): Miles Mollison, the soporific son of Pagford’s self-appointed first family; Simon Price, an abusive and slovenly laborer and Colin “Cubby” Wall, a high school administrator with a serious and disturbing mental illness. Choosing among these attractive candidates becomes too much for the citizens of Pagford, and all hell breaks loose.

The election is particularly fraught because, before Fairbrother died, he was the leader of one of two warring factions on the parish council. The two sides were split over a housing project and drug addiction clinic, with one side, led by Fairbrother, feeling a sense of duty to help the poor, and the other side, led by the “grotesquely obese” Howard Mollison, wishing to expel the black marks on Pagford’s otherwise sterling small-town credentials. It is not a battle between good and evil, but rather a battle between the empathetic and the apathetic. And with Fairbrother out of the way, the conservative bloc seems poised to claim victory.

One legitimate criticism of “The Casual Vacancy” is that it has far too many characters — it is initially hard to follow — but if there are “main characters,” they are Andrew Price and Krystal Weedon. Andrew, the 16-year-old son of Simon Price, faces deep internal struggles over his feelings toward his abusive father, his conciliating mother, his sociopathic best friend and the pretty new girl at school. While Andrew is distinctly a member of Pagford’s middle class, 16-year-old Krystal exemplifies life on the other side. She is the daughter of a heroin addict and prostitute, a feisty and impulsive and promiscuous girl forced to grow up too fast. With no structure at all in her dilapidated home, Krystal is the only parent her neglected three-year-old brother Robbie will ever have.

A discerning reader will see elements of Harry in both Andrew and Krystal. The orphaned or ignored child trying to find his or her own in a cruel world, fighting for friendship, love and truth — this will surely have resonance among fans of Rowling’s earlier work. Indeed, many parallels can be drawn between Harry Potter characters and those of “The Casual Vacancy.” The narrow-minded, repressed, busybody couple of Howard and Shirley Mollison are practically carbon copies of Vernon and Petunia Dursley. And for every flat and comically one-sided character, Rowling can produce another as complex and conflicted as Snape: Parminder Jawanda, a local doctor and council member, or Tessa Wall, a guidance counselor in need of some guidance herself.

At times, the politics of gossipy small-town people is humorous, at other times, it is heart wrenching. Rowling’s central message is, and always has been, one of compassion. The one thing Voldemort could never understand was love — or its cousins kindness and hope. In the magical world of Hogwarts or the darkly comedic hamlet of Pagford, compassion is crucial. And in a town dominated by small minded, self satisfied people preaching self-responsibility, compassion is threatened.

Don’t let the sex or suicide or salaciousness fool you: This is a book about class. The central battle of the book is one over the merits of government intervention and the meaning of responsibility — the battle between rich and poor, the haves and the have-nots. Rowling, who once described herself as being as “poor as it is possible to be in modern Britain without being homeless,” is exposing her readers to the miseries of poverty that they never saw even in a cupboard bedroom or second-hand wands. She is arguing powerfully for the responsibility we have to help the least among us. There is no magic spell to cure heroin addicts or uplift downtrodden children, and Rowling does not sugarcoat. This will not be a book with a happy ending. Yet it is an important one, from perhaps the world’s most important living author.