With regards to a mamzer (Devarim 23:3), see Maayano Shel Torah, quoting a teaching from HaRav HaKadosh of Ostrovska (perhaps the Zichron Shmuel) :
A loose translation: Why does the Torah need to emphasize that a Mamzer is forbidden even after 10 generations?
There is an opinion in the Talmud Yerushalmi that a berya, a complete creature can become nullified if it is intermingled among a mixture of more that nine hundred and sixty.
If you calculate the percentage of a Mamzer that is left after 10 generations, it is 1/1024 - [Note that a Mamzer can marry a convert or descendant of converts. The child is still a Mamzer. Rambam, Hilchot Issurei Biah 15:7-8]
The child of a Mamzer and a non-Mamzerite woman would have 50% Mamzerness. [Halachically the child is completely a Mamzer, but biologically he is only half a Mamzer]
A grandson would have twenty-five percent from the father.
The third generation will have an eighth.
The fourth will have a sixteenth.
The fifth will have one thirty-second from the original mamzer.
The sixth will have one sixty-fourth.
The seventh generation will only have one out of one hundred and twenty-eight.
The eighth will have one out of two hundred and fifty-six.
The ninth will have one out of five hundred and twelve.
The tenth generation will only have one out of one thousand and twenty-four from the original mamzer.
Because one might argue that according to the minority opinion in the Talmud Yerushalmi the child my no longer be a Mamzer after 10 generations, the Torah explicitly refutes that claim.
I don't see why the same logic can't be used to explain why the Torah mentions 10 generations by a Moavite or Ammonite.