Fluoride's effect is topical. It keeps the tooth enamel strong by preventing the loss of important minerals.
According to the CDC, “Bacteria in the mouth produce acid when a person eats sugary foods. This acid eats away minerals from the tooth’s surface, making the tooth weaker and increasing the chance of developing cavities. Fluoride helps to rebuild and strengthen the tooth’s surface, or enamel. Water fluoridation prevents tooth decay by providing frequent and consistent contact with low levels of fluoride. By keeping the tooth strong and solid, fluoride stops cavities from forming and can even rebuild the tooth’s surface.”