Dental fillings are used to repair cavities and restore damaged teeth to their normal function and shape. They prevent further decay by sealing off spaces where bacteria can enter.