1. In the case of a tooth colored composite restoration:
a. it may be that during the placement of the filling, saliva and/or blood entered the tooth thus not allowing the materials to bond with the tooth
b. there wasn't any retention made on the tooth to help it stick and stay in or
c. the materials used by the dentists have exceeded their shelf life and so there can be no bonding to hold the filling in.
2. If this is an amalgam filling :
a. once again, retention here is key. When placing an amalgam restoration, you literally have to create retention by drilling out more tooth in a way that the filling can stay put or,
b. The filling was too big to adequately restore the tooth in which case you will need a different restoration ie. full crown, etc.