Perfect magic is MagicTechnology that hides details in a black box and is still not a pain to work with. This is because you never need to open the black box to adjust things; perfect magic offers the sufficient amount of flexibility by itself at its level of abstraction, or alternatively offers perfect extensibility in a planned way.
Most magic is not perfect, but programming is also full of near 'perfect' magic; users of programming languages generally do not need to descend to the level of machine language or processor design anymore in order to solve their problem, for instance. The abstraction level of the programming language is enough for a large amount of tasks.
Magic is only perfect if the level of abstraction it creates is consistent in itself. This is however not enough; the level of abstraction also needs to have sufficient power, otherwise people will have to hack to make it do the desired thing. Imperfect magic needs knowledge of the underlying system in order to accomplish one's goal - the underlying system shines through or has to be reached.
Reaching perfect magic for a particular subsystem is a process. Interfaces evolve. And of course in order to create and maintain perfect magic one still needs the wizards who understand how it works.
Joel Spolsky wrote recently about LeakyAbstractions?, which is a related concept.
I (MartijnFaassen) think it's quite possible these days to work on a higher level of abstraction than Joel seems to suggest (without having to descend all the time). Perhaps it's a matter of which tools one uses. CeePlusPlus may be a hindrance toward reaching PerfectMagic, for instance.
http://www.joelonsoftware.com/articles/LeakyAbstractions.html
See also ItJustWorks
Compare: SauceOfFailure