Cavities are treated by removing decayed tooth material and replacing it with a filling. (If caught early enough, some cavities can be “sealed”, but if the decay has reached the underlying dentin, filling is required.)
Composite fillings are made from a plastic resin that is applied in layers, hardened with a curing light, then shaped to fit the tooth. After shaping the filling is polished to create a strong, non-staining surface.
Composite fillings can last as long as amalgam (mixed metal) fillings although really large fillings may not last as long. Small chips and cracks can be repaired, prolonging the overall life of the filling.