After writing the seven most famous fantasy books of our lifetimes, it made sense for J.K. Rowling to try out another genre for her follow-up. But “The Casual Vacancy,” published in 2012, was, for some readers, a little too real. It’s a social-realist novel in the tradition of Dickens and Dostoevsky, getting into the sorry lives of the poor, asking why bad things happen to good people and putting the blame squarely on petty bureaucrats. Now, readers will be able to see Rowling’s first post-Potter effort come to life on screen in a three-part HBO miniseries.

Rowling isn’t a politician, but she’s never been shy about her political opinions. She wrote dozens of full-throated tweets against Scotland’s independence during last year’s election, and has loudly supported liberal-minded government aid for the poor — aid she credits as having gotten her through her difficult years before she became famous.

“The Casual Vacancy” is a dramatization of those liberal principles. The story has several overlapping subplots that surround the death of Barry Fairbrother, a council member on the government of the small town of Pagford, England. The council is split into two camps: those who support the government providing for The Fields — the poorer part of town filled with junkies and other people in need — and those who want to disassociate with it. Barry supported the unity between Pagford and The Fields, and his death creates a “casual vacancy” on the seat of Pagford’s council that needs to be filled. In Barry’s absence, both parties prop up their puppet candidates.

In three one-hour episodes, the miniseries adaptation of “The Casual Vacancy” focuses the debate’s stakes over the local community center (with a methadone clinic), and whether or not it should be transformed into a country house (with a spa). The change makes the themes all the more tangible — we see people receiving treatment and the center is a haven for people without any place to go. It’s a testament to the power a local government can have to help people.

The novel was written for adults, and took pains to make that evident, but those parts are largely excised from the series. A condom in the book is “glistening in the grass beside her feet, like the gossamer cocoon of some huge grub.” A character has sex in a cemetery. Rihanna’s “Umbrella” plays during a funeral, to everyone’s shock. None of that’s in the television series, but they aren’t really necessary anymore. At this point, contrasting “The Casual Vacancy” with the “Harry Potter” books is a dated exercise.

Rowling’s liberalism is the real subject in “The Casual Vacancy,” and it comes through onscreen. But of course, Rowling’s ideas only make sense if the viewer can see how the characters are affected by them. A novel can be of any length, so Rowling can take the time to form full characters like Krystal Weedon, a promising young teenager held back by a traumatic childhood and a heroin-addicted mother, and Andrew Price, a romantic hopeful who strikes back against his domineering, abusive father.

It takes time to learn about characters and form an emotional relationship with them. A full-length television series might have the appropriate amount of time, but a movie or three-hour miniseries usually doesn’t. Instead, the series sustains emotional involvement with quality acting. Michael Gambon — who plays the conniving Howard Mollison on the pro-spa team and is so goofy you might mistake him for moonlighting as Albus Dumbledore — is the only really famous one, but they’re all good actors and look like real people.

No character in “The Casual Vacancy” is purely good or evil. A character may have good intentions but may still be uncharitable, or may be charitable but neglect their family. The victims, Rowling says, are created by circumstance. Society’s casualties are created not purposefully, but instead casually.