I assumed that was because it’s the same key-mech that’s in their (external, Bluetooth) Magic Keyboard. Where it itself was branded “magic” just in reference to its two sibling peripherals, the Magic Mouse and Magic Trackpad.
IIRC, the peripheral line itself was started with the original Magic Mouse, which was branded as such because it didn’t have separate external actuatable buttons, but rather was just a smooth surface with a multitouch digitizer on the top half + a single actuatable microswitch underneath the shell†. Apple wanted the image of it “magically” figuring out when you left/right/middle-clicked (despite no L/M/R buttons) or scrolled (despite no scroll-wheel.) Also, the “plug in to pair” experience might have contributed to the claimed “magic”—it was a fairly unique approach to pairing at the time.
† Which is a design with some real benefits, like being easily disinfectable, with no crevasses close to the hand for filth and germs to accumulate in. (There is a crevice on the Magic Mouse, but it’s on the bottom, where your hands will never touch it.)
There is also a bit of “magic” in the Magic line of peripherals that’s not in the hardware itself, but rather in the OS: when the Magic line of peripherals—Apple’s first Bluetooth line of peripherals—was introduced, Apple added a feature to macOS where macOS will “train” the Apple EFI firmware to recognize devices paired in macOS itself, such that the firmware will later attempt to connect to such paired devices on boot. This means that e.g. holding Option on your Bluetooth keyboard to select an alternate boot device on an iMac would actually work. Which was kind of necessary, as those are the peripherals iMacs shipped with.