As the number of television shows has exploded in the last decade, and cable, premium cable and streaming outlets have tried to distinguish themselves from network television fare, one of the ways they’ve done so has been by exploiting what Showtime President David Nevins described as the licenses of those forms: “sex, violence, and bad behavior.”

But escalating violence, particularly in the form of rape and sexual assault, has inspired a substantial backlash, too. In response, fans have defended some series, like HBO’s “Game of Thrones,” by claiming that the violence on these shows reflects the reality of life in other eras. But depending on how far fiction departs from fact, they’re not always correct. And even if life in other times was more explicitly violent than it is today, creators face challenges in balancing violence with other elements of the societies they’re trying to depict.

“Game of Thrones” author George R.R. Martin has explained that, while Westeros is a fictional place, he is very specifically interested both in exploring gender roles and sexual violence in Europe in the Middle Ages in his books, and in pushing back against sanitized visions of that period that appear in other fiction.

“The Middle Ages were not a time of sexual egalitarianism. It was very classist, dividing people into three classes,” he told Entertainment Weekly earlier this year. “And they had strong ideas about the roles of women. One of the charges against Joan of Arc that got her burned at the stake was that she wore men’s clothing – that was not a small thing. … Now there are people who will say to that, ‘Well, he’s not writing history, he’s writing fantasy – he put in dragons, he should have made an egalitarian society.’ Just because you put in dragons doesn’t mean you can put in anything you want. … I wanted my books to be strongly grounded in history and to show what medieval society was like, and I was also reacting to a lot of fantasy fiction. Most stories depict what I call the ‘Disneyland Middle Ages’ – there are princes and princesses and knights in shining armor, but they didn’t want to show what those societies meant and how they functioned.”

Historians have suggested that the norms governing both warfare and sexual assault during this period were somewhat more nuanced than the brutality Martin portrays in his books and that HBO has brought to vivid, and sometimes horrifying life on screen in “Game of Thrones.” But whether you think Martin and “Game of Thrones” showrunners David Benioff and D.B. Weiss have gone beyond history to reinforce the horrors of rape and war, or out of some sadistic taste for violence, is ultimately a matter of individual taste and individual limits. (I tend to think Martin has a strong claim to the former, while Benioff’s and Weiss’ has become weaker over the years.)

“I LOVE HISTORY, so I got to immerse myself in the history of the Plantagenets,” Kurt Sutter said of his new show on FX, “The Bastard Executioner.” “And then when we set it in Wales, suddenly it presented all these great, less documented external conflicts and external pressures as far as the rebellions that were going on.”

Sutter has a taste for what he described as “colorful brutality” when I asked him about staging violence in a very different era. He played a maniacally violent criminal on contemporary police drama “The Shield,” for which he also wrote, and his biker drama “Sons of Anarchy” regularly featured people being tortured, burned alive, or mutilated; Sutter himself played an incarcerated gang member who bit off his own tongue to avoid collaborating with law enforcement.

“My mandate, as it was on ‘Sons,’ is the same for this, which is that the violence, as absurd as it could be sometimes on ‘Sons,’ always came from an organic place, and it was never done in a vacuum, meaning that for every violent act, there are ramifications,” Sutter said. “It’s a medieval setting, and their laws in terms of punishment, a lot were brutal and heinous. So that’s a reality of the world. (But) there’s ways to portray that violence that don’t make it openly gratuitous.”

AT A FIRST GLIMPSE, Sutter might seem to have little in common with Beth Hoppe, the chief programming officer at PBS. But PBS’ forthcoming Civil War medical drama “Mercy Street” posed similar questions about how the network could depict the wounds of war and an experimental period in American medicine within the limits of PBS’ decidedly non-cable standards. While “Mercy Street,” which premieres in January, is a fictionalized account of real people’s experiences, PBS has a long record of historical scrupulousness to point to in justifying what it puts on screen.

“I personally come from the world of factual and science, and I don’t see it as violent, I see it as truth,” Hoppe told me when she and I spoke about “Mercy Street” several weeks ago. “It was this amazing time and turning point in medicine and medical history, and I think it was important for us to portray that. We tried to be really respectful of an audience having a threshold for that and not go too far, but in the same way we were accurate with the history, we were incredibly accurate with the science and the medical procedures that we depict.”

Cable networks, and the people who create shows for them, don’t have the same obligations that PBS does when they’re telling fictional stories inspired by, or directly based on, real history. But Hoppe’s discussion of “Mercy Street” has a good lesson for either fans or creators who want to justify on-screen violence as just a matter of historical record: If you’re going to use a history defense, you better get your history right.