In prehistoric times, a benevolent mutation spread among humanity. This mutation consisted of certain genetic traits that enabled people to mentally access and control certain energies and entities from universes of non-Einsteinian physics that are congruent to our own. Because these other universes possess physical laws that are tremendously different from our universe, those people were able to defy the conventional laws of physics and alter many aspects of reality on a fundamental level by using these energies and entities to manipulate both the space-time continuum and the fundamental interactions of nature (gravity, electromagnetism, strong nuclear force, weak nuclear force). Simply put, they could use powers from other universes to reshape ours on intrinsic levels. Although compared to the scope of the entire universe, it was within a relatively microscopic and localized area. This is the source of the phenomenon that is called magic.
The existence of the Neanderthals is the evolutionary pressure that caused the magic-using trait to evolve in Homo sapiens. Humans won out and the Neanderthals died out when modern man appeared on the scene because many humans had magic, while not a single Neanderthal possessed that gift. With no spells or wands, these primitive magic wielders manifested their abilities rather subtly, it appeared as frequent cases of good luck or happy accidents. However, some of these people acquired some rudimentary control over their power--enough to aid in the hunt and in causing or curing various simple maladies. With this advantage; Homo sapiens was able to supersede the Neanderthal and flourish; driving the less fortunate primitives out.
For a long time, humans of magical stock had a significant place within most societies. The data for this can be found in our ancient texts; including the Bible, Qur'an, Talmud, Dead Sea Scrolls, Book of the Dead, etc. During this time, some magic wielders used magic to perform biological experiments on both humans and animals that permanently altered the DNA of these creatures. These experiments led to the existence of giants, goblins, centaurs, trolls, dragons and all the other magical species of the world.
It is because of social pressure that the magical trait, which is so vital to our past, receded to the small population we see today. An actively anti-thaumaturgical mindset spread across the world, into various cultures for various reasons. People who manifested magical abilities were hunted down and eliminated. Only people who had somehow learned to suppress their abilities survived (magic manifest itself around the age of puberty, if training is withheld during this critical period the ability can never thereafter be fully developed or controlled).
Eventually it was discovered that wood is a magically imbued material. This is because in addition to harnessing sunlight, the photosynthetic process also has a resonating quantum effect that slightly augments the special protein structures that witches and warlocks possess. Using the unique properties of wood, the first magic wands and staffs were created. Wands and staffs function as a "magic focuser". In the same way a convex glass can focus sunlight enough to create a small fire, a wand or a staff focuses the magical potential of its user, not necessarily increasing the magic power, just making it more intense.
The development of the magic focuser allowed for the first time the controlled and reliable applications of magic. This was as much a disaster for the thaumaturgically inclined as the anti-magical factions of humanity - now the magically inclined had a clear and decided advantage over the non-magical or "mortals" as they came to be known to the "magical realm", and these mortals now had a powerful political and economic incentive to hunt down and eliminate the magical race. Eventually those with the magic-using trait declined in number.
Shortly after the invention of the wand and staff, many magical people began exiling themselves from the mortal realm, forming small and isolated magical communities. With the increasing reliance among mortals on scientific reasoning, the break between the magical and mortal realms became more and more complete. Each culture went on to create their own civilization: social structures, economies, governments, etc. Each borrowed a little from the other as the years went by but it became apparent that the mortals must be kept ignorant of the existence of their magical kin for their own good.
In Europe, during the Middle Ages magic was seen as 'heresy' and violently persecuted. Most common magicals were either hunted down and destroyed or suppressed their ability to hide their true nature. As a result, the trait atrophied. Only those that kept their magic active and stayed alive by secluding themselves kept the ability strong. Thus, the magicals collectively decided to form a separate society, using their craft to hide their nature and locations from the increasingly large mortal populations. In 1592, the entire magical realm formally severed contact with mundane society, and removed itself from it, retiring behind a "firewall" of illusions and mortal-repelling charms. The only mortals to know of this secret, magical realm were those mortal husbands, wives, parents, siblings and offspring who chose to accompany the warlocks and witches into their sanctuary. The ruling council of the magical realm, the Magus Council, took steps to limit the likelihood of warlocks and witches encountering mortals either by accident or design. This not only completed the separation of the two cultures but also laid the responsibility on the various magical governments in each country for maintaining the secrecy of everything from magical games to dragons and other magic-spawned creatures. Over the years, for mortals, magic became the stuff of fairy tales and legend.
While the Magus Council allowed for the recruitment of mortal-born magical children, once "Seclusion" was established the actual incidence of such recruitments were exceedingly rare because under such conditions it was virtually impossible for any mortal-born magical child outside the boundaries to have been noted or identified.
Two centuries after the formal adoption of Seclusion, it became apparent to those who were in a position to oversee the magical realm's welfare, that its population's birthrate was insufficient to maintain its numbers at a high enough level either to survive over the long term. In addition, a discernible rise in the number of magical children being born outside the magical realm was reaching a point that they were becoming a security risk. The belief among mortals that magic does not exist could only be fostered if there were no warlocks and witches practicing magic out in mundane society and unintentional or not, these children were practicing magic.
It was ultimately decided among the magical realm's leaders to make a virtue of necessity and to take aggressive steps to identify, train and assimilate these mortal-born magical children into the magical realm, both from a security standpoint by removing them from the awareness of mortals, as well as to take possession of these children's talents to offset natural attrition.
Early in the first half of the 19th century, a cross-section of the magical realm, who had nothing but bad associations with mortals - dating from the era that Seclusion had been determined to be necessary for magicals' continued survival - began to put a renewed emphasis upon the need to distinguish those who were descended from "purebreed" magical ancestry, from those who were "halfbreed" or mortal-born. The magical realm has been dealing with the ramifications of this situation and the response to it ever since, with varying degrees of success.
So the evolution of magic in humanity underwent three distinct phases: prehistoric--magical abilities were selected for as they improved the luck of the individual, suppression--uncontrollable magical manifestations were selected against as they violated the mores of the societies, isolation--people with magical abilities formed their own societies; strong magical abilities again became desirable.
The trait of the ability to use magic is purely a genetic difference and there are a variety of genetic factors controling the it. There is no single gene for the ability, instead it is scattered throughout the genetic material and the combination determines magic using strength. Generally, the children of magicals are also magicals; although, this is not always the case. For magicals the production of a mortal child is extremely unlikely; while for mortals the production of a magical child is even more unlikely.
There is a spectrum of magical abilities in humans, ranging from no discernible magical ability even with training, through magical abilities only manifested with training, up to spontaneous magical manifestations. The majority of humanity falls into the middle category (although due to various selection processes the median of abilities in the mortal societies is well to the left of the median of abilities in the magical societies). The offspring of magical parents who fall into either of the latter two categories are trained into magic using people. Those few children in the mortal society that fall into the third category can be brought into the magical realm, as their magical powers are well above the mortal norm.
The current population of the magical realm stands at approximately 25% mortal-born witches and warlocks, 50% halfbreeds, and 25% purebreeds. Traditionally, all thirty-two of one's genetic great-great-great-grandparents must have been magicals to be considered a purebreed: some more severe schools of thought require several more generations of magical lineage to be considered purebreeds. There are no 'true' purebreeds left; many of those who call themselves such simply strike mortals and halfbreed from their family records.
Almost all magic is done with the use of a supporting tool, typically a wand or staff. By using a wand or staff one's magical powers are greatly focused. Furthermore, most actual spell casting is done by using short incantations (most often in what sounds like a modified form of Latin) accompanied by gestures. This is because certain words and gestures act as psychological triggers to alter the perceptions of the mind, allowing one to summon an extradimensional force to override the usual laws of nature. Potions and talismans also serve as psychological conduits to summon a power. Accomplished warlocks and witches can sometimes perform magic, especially simple magic, without the need for any sort of conduit.
Regardless of how powerful a witch or warlock is, he or she is by no means without limits. For instance, while it is possible to conjure things out of thin air it's far more tricky to create something that fits an exact specification rather than a general one - moreover any objects so conjured tend not to last.
Most magic is relatively neutral--it can be used for bad or good. Some magic, however, is evil in it's intention through and through. Spells of this kind are often called curses. Curses are spells that are often intended to cause harm to another person. This intention to do harm places that spell into the realm of Dark Magic. However, simply casting a Curse spell doesn't mean that a person is using Dark Magic. Ultimately, the deep, true intention of the caster is what makes the difference. Dark Magic is more than simply curses, however. Magic which involves tampering with the free will of another person or which kills another person would be considered Dark Magic.
Some aspects of the magical realm appear less than modern in character, even old-fashioned and quaint; others are more advanced than mortal society. The technological development of the magical realm is ostensibly behind mortal technological development - though, in fact, a large number of technologically-complex devices do exist, and the use of magic renders mortal convenience technologies unnecessary. In addition, magic has a tendency to cause interference with electrical equipment and mortal devices (such as cameras and radios) are able to power themselves on ambient summoned magical forces.
The magical realm not only exist alongside the mortal world, but is embedded within it. The vast majority of magical realm locations are isolated within the wider non-magical area. These locations are hidden by a combination of magical protections (many magical locations are rendered unplottable, or impossible to locate on a map) and the natural tendency of everyday, non-magical people to ignore anything they cannot explain or understand. Although most warlocks and witches live for the most part directly amongst mortals, many of them are unaware of many aspects of mortal culture.