The David Trilogy and its eponymous character took the Animorphs series down a darker path than it had ever gone before, forcing its heroes to extreme measures in order to attain victory. While the series was never particularly lighthearted, the trilogy's aftermath saw the War Is Hell aspect really kick into overdrive, culminating in the last ten books.
Nihil from Brian Clevinger's Nuklear Age, who single-handedly transforms the story from a goofy, episodic, villain-of-the-chapter superhero parody into a tragic, post-apocalyptic drama. All of which is intended, by the author's own admission, as one huge joke on the reader.
The Denarians in The Dresden Files are literal Knights of Cerebus, and far scarier than anything that has previously appeared. Things tend to get a lot worse (particularly if you happen to be a Knight of the Cross and all around nice guy).
It's notable that a series as dark as The Dresden Files can even have Knights of Cerebus. After all, previous antagonists were a drug dealing warlock, psychotic werewolves, a ruthless and vindictive vampire, and an insane member of the fae. But none of them were as evil as the Denarians are.
In the Codex Alera books, the Vord are definitely this. While they make an appearance in the first book, their importance grows quickly to the point where they become the Big Bad by the fifth, completely dominating the previous enemies.
While the newly-revealed backstory for the Ring made it obvious that The Lord of the Rings was going to have a darker tone than The Hobbit, this doesn't really hit home for either the reader or the characters until the introduction of the Nazgul, and especially of their true nature.
Especially noteworthy in that their appearance was completely unplanned: at first, Tolkien wrote about a man in a gray cloak on a white horse (namely, Gandalf finally catching up)...then changed both to black, and took the story into whole new not-Hobbit directions.
Within The Hobbit itself, Smaug. The book is fairly lighthearted at times outright silly, and usual moments of danger the company has typically hand Gandalf to rescue them from. But they meet Smaug, there's nothing they can do against him and proceeds to burn down a nearby settlement. Even though his killed during his rampage, his actions prompt a darker shift in the book dealing the aftermath the settlement's destruction.
The introduction of Dolores Umbridge in the following book didn't help - while not the most evil villain in the series, she's easily the most rage-inspiring among fans. As if that weren't enough, the same book also properly introduces Bellatrix Lestrangenote Bellatrix Lestrange had earlier appeared in the Pensieve in The Goblet of Fire after Harry accidentially stumbled upon the Pensieve, although it took place in the past and thus doesn't count, an Ax-CrazyHero Killer who quickly establishes herself as Voldemort's right-hand Death Eater.
The Yuuzhan Vong indirectly killed off Chewbacca, and Anakin Solo died fighting them. They completely destroyed the New Republic. The Star Wars Expanded Universe took a dark turn the minute they showed up and it has not been able to regain a lot of lightheartedness since.
Atlas from Percy Jackson and the Olympians is the first titan that the heroes fight, replaced the comedic one-shot villains that the heroes defeat during their journey with invincible skeleton warriors that constantly chase down Percy and his friends, and his appearance leads to Bianca and ZoŽ getting Killed Off for Real.
While the earlier villains of Septimus Heap were usually too stupid to be real threats most of the time, Tertius Fume since Queste is the first antagonist that became a threat to the Castle itself, signaling the more serious events of the later books.
Though Neal Shusterman's YA trilogy Everlost was never exactly light, it was only darkly fascinating to begin with. Then Mary Hightower shows her true colors and the series gets dead serious.
Professor Moriarty in the Sherlock Holmes canon. Up to the end of The Memoirs of Sherlock Holmes, most of the criminals Holmes has hunted down have been small fry. Suddenly, you have a genius crime lord who is revealed to have been the Big Bad throughout the Great Detective's career, and he's hellbent on destroying said detective. Not to mention... he seems to succeed in that goal — and even when you know that he doesn't, Holmes holds the Professor up as a standard for the criminals who follow.
It's hard to say exactly when the Alex Rider series became Darker and Edgier. Compare the relative innocence of the first book to the very bleak and cynical feel of Scorpia Rising and be amazed. Most likely Cerebus Syndrome was ushered in by Alexei Sarov, the main antagonist of the third book, who was not only a more competent villain than the previous two, but also one whose psychoses and psychology were more serious than the one-dimensional antagonists Alex Rider had faced before. SCORPIA later ushered in an even darker tone filled with death and trauma and even the occasional Downer Ending (Though the bleakness of the ending was lessened due to the sequel). And when Razim becomes involved, the series ditches comedy entirely.
The Order of Odd-Fish is a YA fantasy book that reads like a less philosophical and less funny Hitchhiker's Guide to the Galaxy. It hardly ever takes itself seriously. Until about one-third of the way in when the Belgian Prankster shows up.
The man with a beard but no hair and the woman with hair but no beard from A Series of Unfortunate Events. Count Olaf is as despicable as they come, but even he gets nervous around his menacing, nameless associates, who arrive just as the series' trademark black humor gets even more grim and mysterious.
Brandon Sanderson's Mistborn: The Original Trilogy starts relatively light, the first book being a heist-novel of sorts, but progressively gets more complex and darker in its deconstruction of fantasy tropes. The Knight of Cerebus in residence is Ruin; when he is freed, things begin to go spectacularly pear-shaped.