Fillings are usually required when a tooth has dental decay or some form of fracture. Dental decay is caused by acid attack (primarily due to diet-sugar and bacteria) which softens enamel and dentine leading to the formation of a cavity /cavities.
The decay is removed and this cavity is now restored with a filling material, which helps to replicate the original function and appearance of the tooth.
Historically, amalgam (containing mercury) were used in the past but with advanced techniques in dentistry, a mercury free material is commonly used today, known as acrylic resin otherwise referred to as composite.
Commonly composite are used as the material of choice due to its durability, mercury free content, its support which provides strength to the tooth and a much improved appearance. Amalgam is commonly associated with tooth enamel fractures (expansion of metal), leaky margins and possibly too strong for the tooth.
All fillings are subject to suitability i.e.: Size and depth of cavity.