Fluoride works by remineralizing tooth enamel, making it more resistant to acid attacks from bacteria in the mouth. This process helps to repair early stages of tooth decay even before it becomes visible. Fluoride also inhibits the growth of harmful oral bacteria, reducing the overall risk of dental caries.