I stumbled across this article, “Witchcraft in Japan: The Roots of Magical Girls” by Alicia Joy the other day. I make no particular comment on its accuracy, but I find it interesting because it attempts to find roots for the magical girl genre within Japanese folklore regarding witchcraft.
A typical essay on the origin of the magical girl genre will typically link it to the American television series Bewitched, which directly inspired both Sally the Witch and Himitsu No Akkochan, which are typically considered the first two magical girl series.
Joy attempts to find some parallels between a few of the genre’s common tropes and elements of Japanese folklore. Since witchcraft is more-or-less universal in folklore, this isn’t particularly difficult. Still, with the broomsticks and pointy hats that often show up amongst magical girls of the “cute witch” variety,” bowdlerized Western folklore is clearly a strong influence.
The genre evolved from that mostly via infusions of tropes from science fiction and superheroes. The girls’ familiars these days are often space aliens, and it’s typical for magical girl series to explain its phlebotinum via appeal to science fiction concepts such as nanoprobes, though little if any real science will be evident.