Magic is a natural occurring force in Harry Potter as portrayed by J.K Rowling.
http://en.wikipedia.org/wiki/Magic_in_Harry_Potter
In the Harry Potter series created by J. K. Rowling, magic is depicted
as a natural force that can be used to override the usual laws of
nature. Many fictional magical creatures exist in the series, while
ordinary creatures sometimes exhibit new magical properties in the
novels' world. Objects, too, can be enhanced or imbued with magical
property. The small percentage of humans who are able to perform magic
are referred to as witches and wizards, in contrast to the non-magical
muggles.
Magicians in general are humans whom have the genetic ability to perform magic.
In humans, magic or the lack thereof is an inborn attribute. It is
inherited, carried on "dominant resilient genes".[1] Magic is the norm
in the children of magical couples and less common in those of
muggles. Exceptions exist: those unable to do magic who are born to
magical parents are known as squibs, whereas a witch or wizard born to
muggle parents is known as a muggle-born, or by the pejorative
"mudblood". While muggle-borns are quite common, squibs are extremely
rare.
Also recall that people with magical abilities are called Wizards and not magicians in Harry Potter.
http://harrypotter.wikia.com/wiki/Wizardkind
Wizardkind are humans born with the ability to use magic. An
individual male human with magical ability, is known as a wizard
(plural: wizards), and an individual female human with magical ability
is known as a witch (plural: witches), though "wizard" is sometimes
used as a gender-neutral singular noun like "man".
Magical ability is an inherited trait usually passed from parent to
child. While pure-bloods are born of two wizarding parents and
half-bloods are often born of one wizard and one muggle or muggle-born
parent, Muggle-born wizards and witches are born with their magical
abilities because they are distantly descended from a Squib who often
marries into a Muggle family. From this point on, that branch of the
wizarding family often loses all traces of its wizarding legacy, which
resurfaces many generations later in a Muggle-born descendant.
As far as where magic "comes" from there is no canon source as to where it originated, as previously stated it is a natural occurring force in the Harry Potter Universe. In fact according the to Harry Potter Wiki the earliest recorded magic was done by Egyptians, Indians, and people from Ancient Greece. This doesn't mean they were the first humans to perform magic however.
http://harrypotter.wikia.com/wiki/Magic
Early History
Ancient Egypt, India and Greece
Egyptian wizards put curses on tombs. Nowadays Curse-Breakers for
Gringotts Wizarding Bank try to regain the treasure locked in those
tombs; one pyramid has mutant skeletons of Muggles who'd broken in and
"grown extra heads and stuff." Indian wizards created the Snake
Summons Spell, which is occasionally used by wizards known as "Snake
Charmers". Magic is integrated into society and wizards are held in
high esteem. However, Dark Magic is already being practised in ancient
Greece. Herpo the Foul created the first basilisk as well as the evil
magic of Horcruxes during that time.
Also I wanted to point out that in the wikia for Magic it also states that it's possible that if Magic were ever revealed to Muggles that it would be considered a fourth branch of science.
As per the International Statute of Wizarding Secrecy, wizards and
witches must constantly hide their magic abilities from the Muggle
world, and thus most Muggles are unaware that magic exists. It is
possible that magic, should it be revealed to the Muggle world, could
be treated as a fourth branch of science, along with chemistry,
biology and physics.
Sources:
Snake Charmers as per my quote above being real...
http://harrypotter.wikia.com/wiki/Snake_Charmer
Herpo the Foul (Ancient Greek Dark Wizard)
http://harrypotter.wikia.com/wiki/Herpo_the_Foul
Herpo the Foul was an Ancient Greek Dark Wizard. He is one of the
earliest known Dark Wizards and his work is still a lasting aspect of
dark magic to date. He is best known as the first wizard to hatch a
Basilisk. He is reputed to have invented many vile curses and was also
the first wizard known to successfully create a Horcrux, perhaps
having designed the ritual himself. Accordingly, he must have
committed murder to split his soul. He is one of the earliest known
Parselmouths.
Appearances
- Harry Potter and the Philosopher's Stone (video game) (Appears on a Famous Wizard Card)
- Harry Potter and the Chamber of Secrets (video game) (Appears on a Famous Wizard Card)
- Harry Potter and the Prisoner of Azkaban (video game) (Appears on a Famous Wizard Card)
- Fantastic Beasts and Where to Find Them