In short, saponins are known to be responsible for the foaming properties of some plants when they come into contact with water, such as soapwort (from which it derives its name), quinoa, and some types of beans. So, if you notice foam in your milk due to saponin, there are likely plant-derived contaminants in the milk or it has been adulterated with some plant material that contains saponin.