Are there any known factors that have a part in whether you become a squib or not? Or is it just a kind of random process, like is it just a one in a million chance that a squib is born?
Squibs are rare; magic is a dominant and resilient gene.
A full and detailed analysis of dominant and recessive genes and how they factor into inheritance is outside my knowledge base, but some cursory research reveals that it's entirely possible for dominant traits to not manifest in children. One example is eye colour; brown eyes are considered a dominant trait, but it's possible for two brown-eyed people to give birth to a blue-eyed child.
Of course, eye colour is governed by more than just a single gene. If we accept that squibs exist, then it's possible that magical ability is likewise carried by more than just one gene.
A fan (and then-biology student) named Andrea Klenotiz proposed a theory for how this might work in practice on her blog. The discussion is over my head and hard to summarize, but she provides a couple of genetic explanations for Squibs, many of which basically boil down to "genetic luck-of-the-draw." Although this is admittedly a fan theory, the discussions on genetics are well-sourced, and I feel confident citing it as evidence that the dominant/recessive inheritance (some of us) learned in high school biology may be more complicated than it initially appears.
According to Klenotiz's theory, then, there are a couple of things that would make it more likely for your children to be Squibs:
If you yourself are a squib:
[T]he squib would be no more likely to produce magical children than a muggle with an equal number of repeats.
You may have a (rare) mutation that deletes some of the genetic elements necessary for magical ability to surface:
There would be two genetic explanations for squibs. [...] [T]he individual has a rare deletion mutation removing a series of trinucleotide repeats.
Random accidents in genetic transmission:
There are many reasons dominant and recessive genes might not show the expected Mendelian ratios of inheritance. [...] "the nonrandom segregation of chromosomes during meiosis [...], preferential dysfunction of gametes in hybrids [...], and preferential success of gametes in fertilization
However, given our low sample size (only two squibs are encountered in the series proper, and only a handful are to be found in all of Rowlings exteded writings) and lack of other detailed writing by Rowling, it's not clear how much of this actually applies in her fictional world. "Random chance" is the only explanation implied by her writings.