A good antagonist isn't stupid when it comes to their role in the story. They believe they are the protagonist, they believe their way of doing things is right, and the really good ones have thought through the issues and possible twists of fate to find their desired outcome. They have brains.
A good antagonist doesn't marinate off-stage while the protag is busy in the limelight. The antag is doing their best to stay a step or two ahead. They may have no narrative voice or POV in the story so it's the writer's job to make sure these unsung villains of fiction get their dues.
Of course, usually, at some point the protag is going to trip them up. How easily is this done? We've all cringed at a movie or book where the antag turns out to be a fluff bunny on the inside or downright absent-minded at the critical moment and the protag sails through the climax gaining all except the satisfaction of defeating a true challenge. Villain-fail. And if the villain fails to give the reader/watcher the most bang for their money, the protag doesn't really win either.
Some things to keep in mind when checking your antag's smarts:
1) What is their backstory? What put them on that particular path and way of following it? What drives them, motivates them, compels them? What's at stake for them?
Please don't say world/galactic domination and glory.
2) What is their personality? Yes. They need one. What character traits do they have that will rub the protag the wrong way and vice versa? What drives them batty? What fills them with fiendish glee? What quirks do they have that might be used for foreshadowing, further wrong-doing, or even humor?
Having a villainous laugh and a fancy for piranhas in the moat doesn't count.
3) What are they good at? What are their special skills? Do they have expertise in not only subjects dealing with the main conflict of the story but side-subjects that might throw more stumbling blocks in front of the protag?
Doomsday machines, nifty laser weapons, and secret passwords—um, right.
4) Who are their people? You know, the characters that live and work around them? Who can they use to further their goals and how? Who shares their goals? Who gets in the way of those goals, aside from the protag and their people? Good antagonists know how to manipulate, delegate, and keep their hands clean.
Hiring dumb, big-bodied hench-people, so overdone.
5) Smart villains have back-up plans. If they can't get Goal A, what is Goal B? If they can't obtain Goal B will they settle for Goal C?
Hm...might need to do some plot outlining on the side for this one. Or you could forget it and just have the ready get-away steed in a cave but somehow that rings of cliché.
6) If antags can find a short-cut, they'd use it. This hails to bad planning on the overall plot and the protag's journey. If the villain could have demolished the hero early on but instead is mysteriously absent long enough for the hero to get their training in or learn the secrets of the cosmos, then that is a massive fail all around. Use your antag to drive your plotting. Let their brains antagonize you, as the writer, and lift your story to better heights.
7) A smart antagonist mentally steels themselves to hide their deeds. They are good at lying, poker faces, alibis, and have their arguments planned out in advance. Red herrings? They have one or two up their sleeves when the occasion demands it.
8) Though they might not admit it, a real antagonist also goes through growth during the course of the story. Whether they become the antag when originally they were not, or turn around and become friends with the protag, or go from reason to insanity—their growth needs to be marked as well. Antags do not stay the same from beginning to end. Push their good and bad buttons with each scene they're in. They get smarter too, even when losing.
We love to invest time and thought in our protagonists. They're the ones we root for. Make them even more sympathetic by giving them antagonists that will push them to greatness. The antagonists start out smarter, more prepared, and with the edge. They call the shots.
What about unintentional protags vs. antags? Some stories the protag stumbles into the antag's way or the antag isn't sure who the exact protag is and makes a mistake or two which soon IDs the protag and gets the two forces colliding. The antagonist still needs to be the stronger element and smart enough to take the changes in stride and work with them to their advantage.
Creating smart antagonists is one way to avoid clichéd villains and one way to make a stronger story. Not that every antagonist needs to be another Professor Moriarty. They don't have to have the big IQ to be smart and challenging. But a little thought and care into the role and character of the antagonist will go a long way to improving the story. We need more memorable villains. Be mean to your protagonists and show your villains more love.
For fun to illustrate one of my points: