1. As yet unexplained, or too complicated to explain; compare automagically and (Arthur C.) Clarke's Third Law:
Any sufficiently advanced technology is indistinguishable from magic.
"TTY echoing is controlled by a large number of magic bits." "This routine magically computes the parity of an 8-bit byte in three instructions."
2. Characteristic of something that works although no one really understands why (this is especially called black magic).
3. (Stanford) A feature not generally publicised that allows something otherwise impossible or a feature formerly in that category but now unveiled.
Compare wizardly, deep magic, heavy wizardry.
For more about hackish "magic" see Magic Switch Story.
4. magic number.