The best villain is just a little bit tougher than the players. Tough enough to win that first fight, but by a small enough margin that the players think that next time, they just have to be on their absolute A-game. So that when they finally do win, they know they have been on their absolute A-game. They know they've accomplished something.
The theoretical exception to this would be extremely long-term villains. I've not yet made use of the technique myself, but if I were to introduce a villain who was intended to be a problem for the PCs for a long time--an entire campaign, say--I might consider making that villain significantly more powerful than the PCs. Make the accomplishment come not from knowing that they did their absolute best, taking out someone who they didn't have a chance against in their first meeting.
If I was to do that, I'd probably also include villains of the just-a-little-bit-stronger variety, perhaps as lieutenants. And even if the PCs wouldn't be able to completely stop the master villain's plans for a long time, I'd be careful to make sure they made progress.