Ketamim only make a woman niddah if they definitely came from uterine blood. If there is a reasonable assumption that the stain came from somewhere else, the woman is not niddah. For example, if a woman was cooking and working with red liquids, as long as it is reasonable to assume the ketemmay have come from the food, she is not niddah. Another common case is when a woman has a cut or scrape that could have bled on to the spot where the stain was found, the woman is not niddah.
Included in this halacha is that a ketem only makes a woman niddah if the stain was found on her body or clothing in a place that it could have conceivably landed there directly from vaginal bleeding. For example, if a woman finds a ketem on the outside of her clothing, since it is not feasible that blood got past her undergarments onto the outside of her clothing, she is not niddah.
If a ketem is found on unwashed clothing that she wore while she had her period, she can assume the ketem is from when she had her period.