The primary mechanism of anti-cariogenic agents involves disrupting the metabolic processes of cariogenic bacteria like Streptococcus mutans. For instance, fluoride enhances the remineralization of enamel and inhibits bacterial enzymes, while xylitol reduces bacterial adhesion and acid production.