Abracadabra began as medicine, not stage magic. The word is first found in a Roman prescription.
The earliest known mention is in the Liber Medicinalis, "Book of Medicine," by Quintus Serenus Sammonicus. Etymonline and Wikipedia place him in the second century, and Wikipedia says he was physician to the emperor Caracalla. His instructions, as National Geographic describes them, were to write the word on parchment and hang it around the sufferer's neck. The word is written on successive lines in a downward-pointing triangle, dropping one letter each time, so that it shrinks line by line to nothing. The patient had a fever, which in that era could kill and is often thought to have been malaria. The logic seems to have been that the illness would fade as the word did.
Where the word came from is a real mystery. Wikipedia lists the main guesses and calls all of them unconfirmed. One reads it as Aramaic for "I create like the word," a reading the linguist Steve Caruso rejects, arguing the word cannot be Aramaic. Another, from the scholar Don Skemer, reads it as a Hebrew phrase, ha brachah dabarah, "name of the blessed." Others link it to Abraxas, a deity of the Gnostic sect of Basilides, whose name appears on amulet stones. Etymonline notes that the Abraxas idea dates to at least the 17th century. The Oxford English Dictionary's verdict, quoted by both Etymonline and Wikipedia, is that "no documentation has been found to support any of the various conjectures."
The charm outlived Rome. National Geographic reports a third-century Greek papyrus from Egypt with versions of the word, and a sixth-century Coptic codex that uses the same shrinking method with a different magical word. Wikipedia mentions a 16th-century Italian Jewish manuscript with a version against fever. English picked up the word in the 1560s.
Skeptics arrived early. Wikipedia says Increase Mather dismissed it as powerless, and Daniel Defoe wrote dismissively of Londoners who posted it on their doorways during the Great Plague. In the 20th century Aleister Crowley altered it to "Abrahadabra" for Thelema, the religion of his Book of the Law.
The shrinking triangle is the most memorable part of the story, and it is the part we have the best evidence for. The meaning of the word itself remains unknown.