I've been having some thoughts about the history of magic in the Harry Potter series of books and have come up with a few conclusions. As has been noted by many people, the basic theory of magic itself is simple enough: It consists of an unknown force of nature, which can be controlled by human thought, and this control can be made much stronger by the use of human speech and the use of wands. This idea is a simple extrapolation of the human condition, in which the world surrounding us is continually changed to suit our needs using only human thought, speech, tools. Given my interest in science and its history, I found it impossible not to speculate about the early history of human magic, using the clues that the author, J.K. Rowling, leaves in the series of books.
First, the books give a rough idea of the history of magic. Since Hogwarts was founded in about 1000 A.D., one can believe that magic, at least as it is used in the books, could not have been around for a very long time, given a quickly growing number of spells and potions requiring a formal setting for cataloguing and teaching. A further clue is given by the use of Latin to cast spells, since this was the language of the middle ages (after 500 A.D.), and the main European language for academic writing and thought for the millenium prior to that had been Ancient Greek. In "Half Blood Prince," it is seen that new spells can be invented and named, so one concludes that most of the spells in the books were probably invented after 500 A.D., and definitely after 300 B.C., the time when Rome started rising in power. The use of wands definitely dates back to 382 B.C., the date when Ollivander's was founded, as given in "Philosopher's Stone," and this is somewhat consistent with the previous conclusion. In any case, one can definitely conclude that the recorded history of magic is much more recent than recorded human history, which dates back ten thousand years.
My main conjecture is that wizards are actually descendents of elves. This may seem a little surprising, given the status of elves in the book, but it is not unlike the scientific theory that human beings evolved from lower species such as apes. The reason for this theory is that elves can use a powerful form of magic which requires neither speech nor wands, so seems more fundamental than human magic, which depends on speech and tools. It therefore seems that elf magic has remained unchanged over the millenia, so predates human magic, which, by the previous paragraph, seems more recent and in continual development. One can imagine that a human-elf mating gave rise to a human being with the "wizard gene," so with magical powers, but which were less than his elfin parent. If one believes this, then one can conclude that such offspring eventually learned to control and amplify their powers using wands and spoken spells. Interestingly, this theory even explains the current elf enslavement: Since wizards were originally weaker magically than elves, they saw them as competition as their own magical powers increased, and they eventually decided to protect themselves by enslaving the entire species. This is not unlike the human practice of genocide by immigrants of native populations. As an example of the threat of free elves, note the fear Lucius Malfoy has of his recently freed elf Dobby in "Chamber of Secrets."