Filing of a prepared cavity depends upon a lot of factor such as.
Site (for an anterior tooth a metal filling may not be acceptable)
Function of a tooth (A posterior tooth might require a very strong filing to withstand the forces produced while chewing food)
Amount of remaining tooth structure: Too much of a hard filling material and very little amount of remaining tooth structure can cause the fracture of the tooth.
Type of material used to fill the opposing tooth( when two different
metals are used to restore two opposing teeth small amounts of galvanic
currents are produced which can be painful for the patient.
Filling materials can be of 2 types
Tooth colored - Glass inomer, composites etc.
Non tooth colored - Amalgam, Gold
Each material has its own advantages for e.g. Amalgam is much more strong & tougher than the tooth colored composite hence ideal for posterior teeth where as composite filling material require very little cavity preparation and hence saves a lot of tooth cutting there by preserving as much natural tooth material as possible.