This has been a question which has interested for some time. We know that a halachically kosher Jew can not marry a mamzer. However the interesting thing is that all of the mamzer’s descendants for all time are mamzerim. Therefore one undetected mamzer could wreak havoc on an entire family tree and possibly on all of Judaism.
According to the Rambam a woman who is raped by some Jew she could not marry and has a child, the child is a mamzer. Now even if we take a conservative estimate and say that such a thing only was kept secret once every 100 years (surely on the low side and no I won’t buy the “The Jewish People were exceptionally holy they would never do such a thing argument”) Then you come to the inescapable conclusion that the only people who are still pure are people who just converted to Judaism.
So remember if somebody brags a bit too much about their yichus you can just say, “Well I know you’re a mamzer”.