The most compelling villains, at least as far as I'm concerned, have a few things in common:
1) They have a clear and obvious motivation for what they are doing; be it revenge, greed, hubris or simple psychosis, they all have a clear reason for what they do.
2) They are intelligent; as has been mentioned above, Lex Luthor stealing 40 cakes just because is not compelling unless you're supposedly writing a comedy. And if that's the case, then the villain can be as petty, stupid and prone to exaggerate every slight against him to ridiculous heights (They said my coat looked silly?! They shall pay for this transgression!) But in a serious piece, the villain should only commit crimes if they actively benefit him. And trust me, those cakes would be a lot cheeper if he'd just bought them.
* Addendum: The villain is not above helping the hero if doing so should prove beneficial enough to outweigh any backlash from his fellow criminals. Especially if his own involvement can be kept secret, or else construed as having been involuntery.
3) They are a legit threat to the hero in some fashion. The villain might be stronger than the hero, forcing our protagonist to rely on brains rather than brawn to carry the day. The villain might be much smarter, putting the hero in a situation where he has to think outside the box or call for aid because the villain has taken precautions against anything the hero would logically do.
4) The villain, even if he is intelligent, still suffers from some fatal flaw: unbridled hubris; insatiable greed; consuming rage. The villain has some form of major flaw that the hero can generally tap to overcome him in some way.
* Addendum: A villain who recognizes his own flaws and seeks to overcome them in some way is made all the more compelling because he's shown to be both selfaware and smart enough to recognize his own shortcomings.
5) The villain is not just a villain; he has a life outside of defeating the hero. Maybe he even hangs out with the other villains on poker night (BtAS: Almost Got 'Im) when he's not busy running an imports shop to sell both legit and stolen goods in between hiring mercenaries to take out a rival, or commit a heist, or publicly sabotage the mayors chances of getting re-elected.