At the start of their ninth season, on the brink of hitting 100 episodes, the players behind “It’s Always Sunny in Philadelphia” have figured out what success feels like: hatred.

“There are certain episodes that hardcore fans absolutely hate,” says Rob McElhenney, who plays Mac onscreen. “And I love the fact that they hated them. It was polarizing. It made you feel something you didn’t expect. And you’ll check back in next week.”

Fan emotion is very welcome, and “It’s Always Sunny” is almost factory-engineered to court controversy. Its characters — five friends/relatives who own a Philadelphia dive bar together — despise outsiders, yet go to comical lengths to harm, belittle and otherwise make fun of each other.

The season nine premiere began with Sweet Dee (Kaitlin Olson) having a meltdown. So everyone else created an elaborate prank to give Dee a false sense of hope that her stand-up career was taking off, only to have her sink lower when she learned the talent scout and her entire laughing audience were paid actors. In the show’s pilot, the gang simultaneously offended the black, gay and thespian communities of Philadelphia.

Even after all the hatred thrown at them, the characters refuse to acknowledge that maybe they’re not great people. And this stasis has always been the “Sunny” secret weapon.

“The joke’s on the characters, and the commentary comes from them making ill-informed decisions,” says co-creator and actor Charlie Day.

Stubbornness lends itself well to “Sunny.” The episodes thrive because, at the end of the day, its five characters land on one side of the issue du jour or the other. This has allowed the show to tackle weighted topics, like the gun control debate, through the tinted lens of people destined to fail. It’s philosophy spiked with schadenfreude.

Because the characters are so resistant to change, the show’s creators — McElhenney, Day and Glenn Howerton (who also plays Dennis) — have grandiose plans. After all, if one variable remains constant, everything else can be chaotic, and the formula still works. They fight about the minutia of execution, but the whole procedure is streamlined to siphon that argument directly onto the page.

“Just like the characters, the writing process remains the same,” McElhenney says. “It’s us sitting in a room talking about what other people aren’t doing.”

So they decide to do things like have Mac gain a whole bunch of weight, for no other reason than to see what a sitcom would be like if a major character suddenly ballooned. Or, how Mac’s fitness obsession would play into this sudden change. Or, what it means now that we know that Frank (Danny DeVito) is in a street gang called the Yellow Jacket Boys.

“What we always wind up hearing is, ‘I hated that episode the first time I saw it,’” Day says. “We always try to be one step ahead of the audience.

“To make any good television, you can’t have it be about nice people doing nice things. Who wants to just watch Mr. Rogers over and over again? If I’m gonna watch a show about Mr. Rogers, I wanna see him, like, murder someone.”