While there are plenty of key Stephen King villains spread throughout the author's massive collection, Randall Flagg is arguably his most twisted. He's shown up in stories like the Dark Tower series, Hearts in Atlantis, Gwendy's Button Box, and, most famously, The Stand. And as a servant of the Outer Dark, Flagg has been referred to by many names - including The Man in Black, The Covenant Man, and Ageless Stranger (which is especially fitting in this case) - and he strives to incite chaos and death wherever he travels.
In Castle Rock, Skarsgård's character is hardly as charismatic as Flagg is traditionally portrayed, but that may well be all part of his elaborate scheme. Not unlike most of King's villains, Flagg is a manipulator, scheming his way through decent people in order to bring out their worst. He's meant to appear fairly average so as to worm his way into the masses before eating away at them from the inside. There used to be a dark cloud hanging over Castle Rock (fueling the fire for horrific events like Cujo's attack on Donna Trenton and her son Tad and the Frank Dodd murders), and it supposedly cleared once Skarsgård's character was placed into the cell. Now that he's been let out, and that a chain of horrors appear to be unravelling yet again, it's that much more evident that he might be Flagg, one of King's most untraditionally wicked villains.
That said, there have been various, mostly-unidentified characters throughout King's stories that King has neither confirmed nor denied were actually Flagg himself (He Who Walks Behind the Rows being one of them, incidentally). So, even if Skarsgård's character isn't ever outright confirmed as a classic King villain with whom readers are familiar, Flagg doesn't necessarily have to be written out completely. Like other depictions of the character, Skarsgård could be playing a more indirect interpretation.
In the town of Castle Rock alone, there have been a handful of memorable Stephen King villains. Standouts include Frank Dodd (aka the Castle Rock Strangler) from The Dead Zone, John "Ace" Merrill from The Body, and the rabid dog Cujo (who some readers believe was actually haunted by the ghost of Dodd, which would make them one and the same), but there is one Castle Rock villain whose reputation rises above the rest - a stately drifter named Leland Gaunt from the novel Needful Things. And assuming Bill Skarsgård is playing an existing King villain, as opposed to an original character, Gaunt is arguably the likeliest candidate.
Aside from the noticeable age difference, parallels between the two characters are actually more evident than they might seem. In Needful Things, Gaunt arrives in Castle Rock in a similar fashion to Skarsgård's character: mysteriously and unannounced. They also both appear to be harmless, despite the fact that Alan Pangborn has his suspicions (in Needful Things, Pangborn sees right through Gaunt's charming demeanor; and in Castle Rock, he believes that the best course of action would have been keeping him locked in his cage). And even though Skarsgård's character hasn't yet shown any signs of trying to acquire the souls of Castle Rock locals, there are other distinguishing features that just nearly confirm this theory.
At New York Comic Con 2017, Skarsgård was asked by Castle Rock's panel moderator if he had read any Stephen King books prior to playing the role in order to prepare himself. He did, and the book was Needful Things. What's more is that Leland Gaunt is described as having eyes that can change color; and though Skarsgård hasn't gotten much screen time in the first few episodes, some closeups have revealed that he's either got heterochromia iridum (different colored eyes) or does, in fact, share yet another correlation with Gaunt. Skarsgård's character may not be quite as personable as Gaunt, nor does he seem quite as skilled at feigning empathy, but the Leland Gaunt from Needful Things wasn't just pulled out of an underground cage which he's been locked inside for the past three decades. With different interpretations come different iterations.
Furthermore, while several other Castle Rock-based characters and stories get blink-and-you'll-miss-it callbacks in the show - namely when Henry Deaver is flipping through old newspaper clippings and discovers headlines that refer back to Cujo, Needful Things, and The Body - Leland Gaunt stands out most of all. In an article referring to Needful Things (it reads: "Shopkeeper Missing After Oddity Store Fire"), the words "Leland Gaunt" and "missing" are underlined in red ink. And though this can easily just be a throwaway easter egg for fans, it can also just as well suggest that this greedy demon has unfinished business in Castle Rock.
If none of these identities turn out to be true, Skarsgård's character will still fill a familiar mold at the heart of most King stories; he'll be playing an outsider wreaking havoc on a small town in some way or another, in the tradition of the aforementioned characters, as well as others like Kurt Barlow from 'Salem's Lot, André Linoge from the written-for-TV series Storm of the Century (which gets a slight nod in the show), and even the possessed 1958 Plymouth Fury from Christine. And from what little audiences see of Skarsgård in the first half of Castle Rock, it's evident that he's not far from standing toe-to-toe with King's long line of illustrious evildoers - assuming he's not one of them himself.