Original Answer
This comes from my high-school chemistry book (in German):
Hexanhexol (sorbitol) is common in apples, cherries and other fruits. The sweet taste comes from the OH-Groups within the molecule. […]
Sorbitol is half as sweet as sugar (glucose), but does not cause carries.
Furthermore, foods containing sorbitol feel cool in the mouth, as
sorbitol is drawing energy from its surroundings in order to dissolve.
Pentanpentol (xylitol) has very similar properties [i.e. not causing carries], but is as sweet as glucose.
I think, if school books teach that xylitol prevents caries, this argument must be pretty solid. (School books are usually very conservative and only teach bullet-proof things, at least in Germany).
I can't tell you exactly why xylitol and sorbitol prevent caries. It probably has something to do with the fact that neither we nor bacteria are able to process any source of energy other than carbohydrates, and so the cariogenic bacteria do not have enough "food".
Following from this, your diet must consist of glucose (or polysaccharides which will be broken down into glucose), otherwise you would have starved to death! Therefore, if you do not brush your teeth regularly there will be enough "food" for caries because of polysaccharides in other foods that we eat.
If you brush your teeth regularly and have a good oral health, there will be almost no gains (apart from the diet/weight bit) by using a sugar substitute!
Edit
Some sources and studies about xylitol and dental health:
- This Nature Article discusses the benefit of xylitol compared to other polyols.
Chewing xylitol gum is certainly effective at preventing caries
development compared with chewing sugared gum or not chewing any gum.
Xylitol gum appears to be more effective than sorbitol gum or
combinations of xylitol and sorbitol.
- This Study from the Japanese Microscopy Society claims that xylitol remineralises tooth enamel. However, as @JohnP pointed out in the comments, there is a potential conflict of interest as the sponsor of the study is a manufacturing company which also produced products that include xylitol.
We morphologically determined the effects of xylitol on the
remineralization of artificially demineralized enamel. […] The MIP
evaluation indicated that remineralization was more prominent in
layers at depths of 50–60 µm in the xylitol samples than in the
non‐xylitol samples.
- As Matías Fiedemraizer pointed out in the comments, the AASP recommends Xylitol for patients with high risk of caries:
The American Academy of Pediatric Dentistry (AAPD) recognizes the
benefits of caries preventive strategies involving sugar substitutes,
particularly xylitol, on the oral health of infants, children,
adolescents, and persons with special health care needs. […]
Dosing frequency should be a minimum of two times a day, not to
exceed eight grams per day.
- This article shows that the risk of AOM is reduced for kids with xylitol intake.
There is fair evidence that the prophylactic Administration of xylitol
among healthy children attending day care centres reduces the
occurrence of AOM by 25%. This meta-analysis is limited since the data
arise from a small number of studies, mainly from the same research
group.
- This is a review assessing whether xylitol can in fact prevent tooth decay. This is their conclusion:
We found some low quality evidence to suggest that fluoride toothpaste
containing xylitol may be more effective than fluoride-only toothpaste
for preventing caries in the permanent teeth of children, and that
there are no associated adverse-effects from such toothpastes. The
effect estimate should be interpreted with caution due to high risk of
bias and the fact that it results from two studies that were carried
out by the same authors in the same population. The remaining evidence
we found is of low to very low quality and is insufficient to
determine whether any other xylitol-containing products can prevent
caries in infants, older children, or adults.
The abstracts and findings of all articles are available online, one has to purchase the whole article though to be able to read everything.
My conclusion
Judging from all the studies, I would just have a normal diet and brush my teeth regularly. For me, it is too much effort to change my eating habits, try to eat foods that only contain alcohol sugar when the benefits are not even clear.
It is important to note however that xylitol does prevent caries if used consequently as a sugar substitute and no other polysaccharides are consumed. This is not recommended (1). But fluoride tooth paste prevents caries it at least to a very similar extend.
Lastly, one has to consume xylitol at least twice a day to get a positive effect [AADP article], but only a maximum of 8g, as osmotic diarrhoea is a major possible side effect.
(1): This was an understatement. Under no circumstances try to only consume xylitol and no other carbohydrates!