One way to identify mechanisms by which the body tames the microbes in the mouth is to observe what happens when those mechanisms are impaired:
Deviation from symbiosis among the bacterial community
leads to “dysbiosis”, a state of community disturbance. Dysbiosis
occurs due to many confounding factors that predispose a shift in the
composition and relative abundance of microbial communities.
(Dentistry Journal)
1) Immunity
Normal innate, cellular and humoral immunity helps to prevent oral flora from causing infections.
a) When the immunity is impaired due to a disease (HIV/AIDS, cancer...) or long-term treatment with antibiotics, steroids, immunosuppressants or chemotherapeutics, a part of normal flora, such as the yeast Candida, can overgrow and cause oral thrush.
Host defense against infections with Candida spp. depends on rapid
activation of an acute inflammatory response by innate immunity,
followed by an incremental stimulation of specific immune responses
mediated by T-cells (cellular immunity) or B-cells (humoral immunity). (Immunology of oral candidiasis, J Pharm Bioallied Sci.)

Picture 1: Oral candidiasis (source: Wikipedia, creative commons license)
b) Impaired immunity can result in osteomyelitis of the mandible, caused, for example, by the Actinomyces bacteria:
Systemic factors such as diabetes mellitus, agranulocytosis, leukemia,
severe anemia, malnutrition, or alcohol abuse affect immune
surveillance and lead to impairing the osteomyelitis
Actinomycotic druses and filaments were detected from the sequestrum
of the fracture site (Rapidly Progressing Osteomyelitis of the
Mandible, Case Reports in Dentistry)
2) Saliva
Saliva helps to prevent mouth infections by flushing microbes into the gut and by the antimicrobial substances.
Among such protective factors, the flushing effect of saliva flow is
the most important one...(Antimicrobial function of human
saliva--how important is it for oral health?, Acta Odontol
Scand.)
Importantly, saliva is crucial for defense against microbial species,
as it is rich in antimicrobial compounds such as hydrogen peroxide,
lactoferrin, and lysozymes...disruptions in saliva secretion increase the frequency of oral
conditions such as oral candidiasis, gum disease, and tooth decay
(caries), as well as respiratory tract infections (The power of
saliva: Antimicrobial and beyond, PLoS)
Impaired saliva excretion due to a disease (salivary stones, Sjögren's syndrome, untreated diabetes, radiation injury) or drugs (antihypertensives, antidepressants, tranquilizers, diuretics, antihistamines...) can result in dry mouth (xerostomia), which increases the risk of oral thrush and other mouth infections.
3) Lack of substrate for microbial overgrowth
Clean healthy mouth does not contain enough food for microbial overgrowth.
On the other hand, in untreated diabetes mellitus, the abundance of glucose in the saliva promotes the overgrowth of the yeast Candida (oral thrush):
A dry mouth coupled with a higher amount of glucose in the saliva can
also make for favourable conditions for thrush.
(Diabetes.co.uk)
Mouth full of food debris due to poor hygiene can promote bacterial overgrowth:
Periodontitis is caused by certain bacteria (known as periodontal
bacteria) and by the local inflammation triggered by those bacteria.
Although these periodontal bacteria are naturally present in the
mouth, they are only harmful when the conditions are right for them to
increase dramatically in numbers. This happens when a layer of
bacteria and food debris, known as plaque, builds up and is left
undisturbed on the teeth...(What is periodontitis, European
Federation of Periodontology)
The bacteria from normal oral flora often involved in periodontitis: Porphyromonas and Streptococcus (Lumenlearning.com).
4) pH
The normal pH in the mouth is 6.2-7.6 (Journal of Indian Society of Periodontology). When it falls under certain value known as critical pH (~5.5), acids derived from bacterial fermentation of dietary sugars start to dissolve tooth enamel and cause caries. The bacterium Streptococcus mutans is a part of normal oral flora, but is commonly involved in caries (Lumenlearning.com).
5) Low susceptibility of mouth mucosa for certain microbial toxins
Certain microbes, such as Staphyloccocus aureus, which are a part of normal mouth flora do not likely cause infections in the mouth, even when they appear in the mouth in much greater amounts, for example, in food poisoning and even if these microbes can cause severe diarrhea (Centers of Disease Control and Prevention). This is because the mouth mucosa is not susceptible for the toxins secreted by these bacteria, while the stomach or intestinal mucosa is.