How do Shaving Creams, Foams, Soaps ensure cut Hair Fragments that stick & clump between Safety Razor blades are easily washed away?
Active chemicals are called surfactants. It is well explained in colloid chemistry books and kind of in wikipedia (https://en.wikipedia.org/wiki/Surfactant)

And it is possible to find alternatives for such chemicals in nature, but they won't be as effective as artificial.