OOH, I've thought of another one. Favorite villain #2.
This one comes from Star Trek... specifically, the "extended universe stuff" (books).
Story time, because I always just loved this one:
This guy's name is simply "0". No, I dont know why. 0 is a character who is rather similar to Q, in that he's all-powerful and can do basically anything with no effort... the guy could probably annihilate the universe if he felt like it (of course, he's stuck IN it, so he probably wouldnt... though he'd likely survive it if he did). Very similar type of entity. Like Q, his power is incomprehensible, and for any mortal, seeing his "true form" would destroy their sanity instantly. This all gives you an idea of just how much of a threat he poses.
Well, the book starts out with the Enterprise (Picard's Enterprise specifically) approaching the Galactic Barrier. For the uninitiated, the Galactic Barrier is sort of a wall that completely surrounds the galaxy. It is incredibly dangerous, and trying to pass through it is... not a very smart move. It'll utterly wreck any ship that tries, while at the same time totally destroying the minds/sanity of whoever is on board. No ship has ever passed through successfully (though Kirk tried once... yeah it didnt go so well). The origin of the Barrier is unknown at the time.
Well, this scientist guy believes he's created a device that can finally drill a hole through the Barrier, allowing a ship to pass through, so the Enterprise is, of course, called upon to perform the experiment with him. Upon getting close to the Barrier, Q appears. He issues a very stern warning to Picard, saying NOT to mess with the Barrier at all. The female Q also shows up at the same time because why not.
Q keeps showing up as the preparations continue, until eventually... as usual... Picard gets fed up with Q and just yells at him to stop being cryptic and just explain himself for once. Oddly, Q complies for once instead of just making a snarky response, and warps out with Picard on a wild trip through time, and Q's own history.
A bunch of stuff is seen, culminating with Q's younger self declaring that he's supremely bored. He goes to the Guardian of Forever (an ancient device that can portal you to other dimensions) and asks it to simply "show me something new!" It opens up, and Q jumps through, finding himself in a bizarre wasteland. There, he meets 0. It's made clear to the reader that something is just really off about this guy, but young Q is just too dense to notice. 0 is apparently stuck there, having once sustained a wound that "removed his ability to travel at faster than light speeds or jump dimensions", which is also a bad omen... how could something like him be harmed? He asks Q to take him out of that world, as Picard and the older Q watch. Picard, of course, instantly realizes that younger Q is about to do something phenomenally stupid. Q himself basically has this "oh God, here it comes" look the whole time.
Young Q takes 0 back through the Guardian of Forever.... only for the thing to activate, go bonkers, and try to resist, while spitting out ominous errors about "entity incompatible with universe parameters". Young Q of course is stronger than the Guardian device, and succeeds in bringing 0 over.
Cue the evil lunacy. 0 tricks Q into participating in "testing lesser species", making Q think that he wants to test them to help them transcend or something. Turns out, his tests are brutal... and he really, REALLY doesnt like losing. Young Q is all excited that the planet they're testing is passing all of 0's tests, but 0 isnt having any of it... right before the inhabitants would begin truly travelling the stars, 0 crushes their sun. While he's doing this, his appearance sort of glitches out, changing rapidly between his normal form, and this freaky mass of spastic tentacles. So there's Bad Sign #2. Young Q does everything to try to stop him, but 0 has friends who came along, and young Q may be infinite, but he cant defeat four equally infinite foes at once. Eventually, this all culminates with a war between the Continuum, and 0's crew. 0 is defeated, shoved outside of the galaxy, and the Barrier is created.
So, the great Galactic Barrier, its entire function is just to keep out this ONE guy (the other barrier, at the core of the galaxy, is to hold the strongest of his buddies). That's the only reason it exists. That's just how dangerous 0 is.
Needless to say, that's not the last Picard sees of him. It turns out that the scientist was never acting alone... 0 had found a way to get his influence through just a tad, enough to infect this guy's mind. With 0's help, the scientist did manage to crack the Barrier, letting 0 through.
Problem was, 0 had been trapped out there for an absurd amount of time. Godlike though he was, his sanity was destroyed. A complete madman now, he jumps onto the Enterprise and of course becomes an immediate problem.
Picard yells at Q to do something about it, and Q attacks 0... only for his attack to do literally nothing. Q goes "...oh no", which isnt something you want to hear from him. As Q later explains, while his power is truly infinite, there are layers of reality that are so deep, that neither he nor any of the other Q would ever dig that far down, because it'd wreck their minds. 0, already insane, went that far, and had become MORE than infinite. Which doesnt make a whole lot of sense, but he did it anyway. So strong that even Q could not scratch him. And his entire goal is revenge against Q, and control of the galaxy... with the Enterprise as his way of getting around.
Naturally, things escalate from there, as 0 restricts Q's power, forcing him to physically run away on the ship while 0 has fun chasing him. Throughout this, Q is confident that "Picard will think of something, he always does". So, he's relying on a normal guy, powerless, to stop a more-than-infinite and totally insane eldritch abomination from beyond time and space. Just a bit of pressure.
The entire time though, the Calamarain (this weird cloud thing composed of numerous entities that was *almost* near Q's level of evolution) had been attacking the Enterprise entirely because Q was on it (one of 0's early targets was them, and they'd seen Q with him, so they hated him).
OF COURSE Picard does think of something. He convinces the Calamarain to board the Enterprise, and help Q, and that 0 had been their true enemy, not Q. They do so, and sort of fuse with him at the last moment. I always think of this part of Q sort of going Super Saiyan, because that's basically what happens. 0 is beyond infinite, but Fused Q is way, WAY beyond that.
Cue the most anti-climactic moment I've seen in the series: he points at 0, turns him into a spider, and steps on him, and that fight is over. 0 isnt killed (he probably cant be) but with the help of the Continuum, he's shoved out again and the Barrier is restored.
Of course, this means there's STILL no real way out of the galaxy... and all because of this ONE villain. And that's just how terrible he is. And that book (well, trilogy) is one of my personal favorite reads, really.
Incidentally, neither 0 nor even Fused Q are the most powerful things to show up in the series. Star Trek has ALWAYS had that crazy power-creep going, with all sorts of godlike characters and eldritch nightmares showing up.