Enamel, the hardest substance in the body is made up of crystals called hydroxyapetite crystals or HAP for short. Fluoride can get incorporated into the enamel to form a new crystal called FAP or fluoruohydroxiapetite. Enamel made with this is much stronger and more resistant to demineralization and dental caries.
HAP to FAP
Hydroxyapetite crystals are packed tightly together to form a regular solid structure called a lattice. The enamel lattice contains hydroxy ions (OH-). Fluoride (F-) has the same negative charge and can replace the hydroxy ion to form the more acid resistant crystal FAP, by a process known as iso-ionic exchange. It's basically like a substitution on the footy field where you replacing a current player with a better player.
If the outside layer of enamel has high concentrations of fluoride, calcium fluoride (CaF2) will form on the surface- the calcium comes from saliva. When this is exposed to acid, this calcium fluoride becomes negatively charged, forming an ion CAF2- which diffuses into the enamel to make FAP crystals, thus increasing the strength and resistance of the enamel.
Fluoride in saliva (even at low concentrations) helps encourage remineralisation by forcing calcium and phosphate out of saliva onto the tooth. The higher the pH of saliva, the greater the remineralisation that occurs.