Comment by mishu2
While there are indeed many factors (genetics, the specifics of the microbiome in your mouth, probably some we don't even understand at the moment) at play, oral hygiene (and diet for caries, but not gum disease) is currently considered by far the most important modifiable risk factor.
Considered by who? Dentists, or scientists? Dentists seem to be about 5-10 years behind the research on this topic. I know of a single practice that has started doing oral microbiome testing.
We know that caries are caused by acid eroding the teeth. And we know which bacterial species produce this acid, how quickly they secrete it, and how common they are. The most significant source is Strep. Mutans. Sugar is an input to this process, and Xylitol (a sugar alcohol) can kill this bacteria selectively.
Diet is probably the most significant way to affect gum disease. Gum disease is associated with systemic inflammation and auto-immunity. The same dietary interventions that are used to treat those conditions also treat gum disease.