Nothing is guaranteed forever, so it is reasonable to give patients the best approximation. And it's not always the filling per se that fails, but may be an associated cusp fracture. So, composites 7 years, amalgams 12 years, crowns 15-20 years, .... Many factors affect the longevity - size, shape, depth, chewing forces, front tooth, back tooth,...
e.g. I have 6 fillings in my teeth. The 2 front composites are small and have been there since 1975, the only change is mild discolouration. The 4 back amalgams (chewing pressures) had been placed about 1970. In 2 of those teeth I had a cusp fracture in 1995, and another in 2000 - one was rebuilt with amalgam, the other with composite; still going OK.