Know that ignorance is of three types:
The first is that one knows that the impurity was present during the prayer, but only after concluding it. This is the case mentioned by the author.
The second is that one knows it was present during the prayer, but does not know whether it is among the impurities that prevent the prayer from being valid or not. For example, a man prays while there are stains on his garment, not knowing whether they are among the impurities that are overlooked or not; then it becomes clear that they are among the impurities that are not overlooked.
The third is that one knows it was present during the prayer, but does not know that removing it is a condition for the validity of the prayer. The example is clear.
In all these cases, he must repeat the prayer, because he has failed to fulfill a condition of the prayer—namely, avoiding impurity. It is like one who prays without ablution, unaware that his ablution has been invalidated.
His statement, “or he forgot it,” means that he forgot that impurity had come upon him and remembered only after concluding the prayer. According to the author’s view, he must repeat it, because he has failed to fulfill a condition of the prayer—namely, avoiding impurity. It is like one who prays while in a state of ritual impurity, having forgotten that his ablution was invalidated.
The same applies if he forgot to wash it.
The stronger view in all these cases is that he does not have to repeat the prayer: whether he forgot about it, forgot to wash it, was unaware that it had come upon him, was unaware that it was an impurity, was unaware of its ruling, or was unaware whether it occurred before the prayer or after it.