In a way that seems to involve magic or supernatural forces. The door opened magically without anyone touching it.
In a way that is enchanting or delightful. The garden was magically transformed into a winter wonderland overnight.
Informally, in a way that happens automatically or without an apparent cause, as if by magic, especially in technical contexts. The memory is magically freed by the garbage collector.