Both factors play a role.
It is quite obvious that a modern language with a scientific register (not all modern languages have that) has a richer vocabulary than any ancient language, just enumerate the systematic names for chemical compounds, diseases in medicine, species in biology, etc.
And it is also quite obvious that we know any ancient language only partially, and that a lot of ancient words aren't transmitted to us. Many of them were probably never recorded at all, for other words the loss of texts is the explanation.