I’d say the main factor is what we focus on here: diet. It’s able to directly influence the state of the flora. If you eat nothing but sugar and starch and don’t eat anything containing prebiotics, probiotics or fibre, it’s only a matter of time before your intestines take a turn for the worse. It’s probably a cascade from there as your immune system goes into disarray and the yeast is able to proliferate.
I’m sure there are many other factors as well, though. For example, genetics, age, the ‘Hygiene Hypothesis,’ exposure to mould/fungus, toxins and other immunosuppressants or immune system conditions. It’s not hard to imagine how candida could take over when you think about it.