Both of Hermione's parents were muggles but she was a witch. I just finished Half blood prince but there is no explanation about this yet. What is the criterion to be born a witch/wizard? Isn't it necessary that at least one of the parents be a wizard too? May be books have elaborated more on this if some one knows, please let me know. Thanks.
It's not depended on any criteria, it mainly depends on gene A wizard have to born with the magic gene regardless of their parents.
You can see it in the harry potter wikia
Those born to Muggle families but who are skilled with and have the magic gene are referred to as Muggle-borns. A child born with magic to two Muggle parents is considered a Muggle-born.
Muggle-born is the term given to a witch or wizard who is born to two non-magical parents. Their magical abilities do not seem to be at all affected by their Muggle parentage. In fact, many Muggle-borns have been among the most talented witches and wizards of their time, such as Lily Evans and Hermione Granger.
JK Rowling quoted
Muggle-borns will have a witch or wizard somewhere on their family tree, in some cases many, many generations back. The gene resurfaces in some unexpected places.
And you can see many point of views and facts in this Quora question
Muggle-borns are descendants to Squibs. You can consider magic being some form of genetic marker that can go dormant and resurface years or centuries later even.