Arguments have been made that magic is a recessive allele.
Here is a link explaining the argument.
If you hate clicking things I will give you a quick summary. As you may remember from biology class your genetic makeup is determined by alleles you receive from each parent. These can be dominant or recessive. So say there’s a magic gene, there are two possible alleles, M for muggle W, for wizard. If the Muggle gene is dominant then you need two copies of the wizard gene to be a wizard. So muggle borns would come from parents who were both carrying one copy of the wizard gene but it was being blocked out by their dominant muggle allele. Do you get the general idea?
But the thing is it doesn’t work. It does explain muggle borns and why it’s necessary for them to have a wizard in their family history but it doesn’t explain why every half blood who gets a mention is a wizard. Tom Riddle, Severus Snape, Remus Lupin, Seamus Finnegan, Gildroy Lockhart, Dean Thomas, Minerva McGonagall, Sybill Trelawney, Celestina Warbeck and Dolores Umbridge.
Lockhart admittedly had two elder sisters who were squibs. Which is odd as squibs are allegedly rare. Possibly there is an under reporting of squibs due to some sort of associated shame.
Anyway the point is there are many half blood wizards and witches and very few report full silblings who are squibs. Realistically most wizards who marry muggles should have non magical children. The only way they could have magical children is if the muggle already possess one wizarding allele. Then there is a one in four chance of a wizading child. This is just not born out by the half bloods in the books.
A better explanation.