What I mean by that is using any kind of ability they may posses creatively. For example if the villain is a magic user then I will use a very creative spell selection. I may also use scrying or even a spy network to learn about the PC's abilities they may posses and have spells ready to counter them. My villains always try to cover their tails in any way they can.
Using spells creatively is 100% okay. Spying on the PCs... that gets into the territory I mentioned earlier, along the same lines as throwing overwhelming force at your enemies. It's good tactics but a crummy game, so I try to avoid giving them enemies who are smart enough to do such things. I've found them unsatisfying in the past. If I
were going to do scrying enemies again, I'd think long and hard about ways to construct the game in such a way that players are aware that they are being spied on (even if their PCs aren't) and have some possible ways to respond.
The fundamental principle I have in mind is that the game isn't fun when 90% of the action is happening in the DM's head and not at the table. You can imagine a hypothetical scenario in which the PCs invade the BBEG's fortress and find it totally empty at first. They spend an hour or so tearing open secret compartments looking for treasure... and suddenly they're all hit with 200d6 +200 of damage during a surprise round. Wham, you're dead without ever seeing the threat! Even if the DM played it totally straight and by the rules, that's an unsatisfying experience because the DM is the only one who gets to see the bad guy's moves. I've thought long and hard about ways to allow D&D to be more of a game of partial information (like Kriegspiel) but I don't have a good solution yet, so my interim solution is just not to build those kinds of intelligent archwizards/liches into my sandbox or at least to make them apathetic towards the PCs by default instead of actively hostile.
If I wanted to have that kind of enemy anyway, my current solutions would be limited to (1) change the way scrying works in that campaign so the scried-upon has a chance of sensing the scry attempt and gains some information about the scrying, which guarantees over time that the PCs will realize what's happening; or (2) send them an incredibly realistic dream from an unexplained source that just happens to clue them in on the information I want them to have.
Yes, D&D is a fantasy world, but it's also a game played by real live people. You want them to have a good experience, and if that means changing the rules of the game to make it better, or constructing your campaign in a certain way in advance to avoid un-fun scenarios, so be it.