The principle is its chemical composition. Probably all sodium stearate. Stearic acid group, as its name implies, is hydrophobic and incompatible with water. But because this part is organic, it can be combined with dirty substances such as oil pollution to form a good combination, and then the sodium-based part is hydrophilic and can be well combined with water. So oil pollution passes through this substance.
Put it in water and wash it. The reason for foaming is that this substance is not completely soluble in water after being combined with oil. This is why bubbles are often dirty.