How does rubbing soap on wet skin produce foam, and does it really enhance cleaning? We tend to rub soap after applying it to the skin. I found it interesting that the mere act of sliding our hands on the wet skin surface produces millions of air bubbles in the liquid, that later becomes foam. I wonder how exactly we manage to do that?

[Image source] This is the kind of foam I am talking about (foam/lather/froth... I find these words confusing).
Talking of foam, I have an unexplainable feeling that the effectiveness of a wash/bath is directly proportional to the amount of foam produced. Coming to think about it, it seems like the opposite should be true.
Soap without foam has a lesser amount of soap solution protruding out as bubbles; most of it is in contact with the skin surface, where actual cleaning takes place. I suspect that this is a misconception that got imprinted to our minds because soap does not clean or foam well in hard water (but that has an entirely different reason).
So to sum up,

*

*How exactly does rubbing soap on the skin produce foam?

*Is there any plausible reason why a soap with foam can do better cleaning than the same soap without any foam?
Simple and straightforward answers are welcome.
 A: 
Is there any plausible reason why a soap with foam can do better cleaning...?

In the usual use-case for liquid foams, it's not about better cleaning (or, better extinguishing of fire, or better entrapment of radioactive contamination, or whatever it is that the foam is supposed to do;) It's about better spreading of a very small amount of solution.
Foaming a solution bulks it up by a factor of tens to hundreds of times, and that extra bulk makes it easier to evenly spread it around to all of the places where it needs to go.
A: No, the hand-soap does not necessarily produce the bubbles.  In fact, most people that use bubbly hand-soap think that no bubbles mean that the soap is not cleaning properly.  Toothpaste is the same way too!
what I’m saying is
Hand-soap, body wash, shampoo, and toothpaste are mostly, some aren’t, made to foam so that people think that it is cleaning

“You will never regret the time spent blowing bubbles.”
-Janis Lynn

A: The soap bubbles are a side-effect of the cleaning process. It is the mixing of air with the soapy water, and the film stability of the resulting bubble walls, that generates and maintains the bubbles. (Note that soap bubble liquid contains glycerine, which is a powerful film stabilizer that makes the bubbles last as long as possible).
Note also that it is possible to design molecules called surfactants that behave like soap but do not create a foam of bubbles when agitated (these are used in dishwashing detergent mixtures) and furthermore that it is also possible to design molecules which when added to foamy soaps inhibit the creation of bubbles. These are called defoaming agents and are added to soap or detergent solutions which have to be pumped mechanically through filters and pipes, so the pump impeller does not spin out of control and lose prime when it ingests a slug of foam. Defoaming agents are commonly used in things like rug shampooing machines and self-powered floor scrubbers.
It is also possible to design detergents which foam up very strongly and persistently when mixed with air, by adding chemicals called film formers to them, as in the glycerine example above. Such detergents are used when processing things like crushed mineral ores, where the foam phase is used to carry off specific constituents of the crushed ore.
A: I think #1 was answered very well by niels nielsen so to answer #2:

Is there any plausible reason why a soap with foam can do better cleaning than the same soap without any foam?

Time spent rubbing hands.
Foam/bubbles are fun. If it takes time to produce foam then it increases the amount of time a person takes rubbing their hands together. I've used soap before which does not produce foam and it's much less satisfying to use as there is no indication that I've rubbed long enough nor rinsed long enough to get the soap off.
Additionally, my toddlers absolutely love rubbing their hands together with foamy soap. As long as I turn off the water then they will gladly keep rubbing instead of prematurely rinsing their hands.
A: Molecules of soap are composed by one hydrophobic and one hydrophile end. They clean because the hydrophobic end sticks to dirt stuff that is normally greasy, while the hydrophile end allows the product (soap + dirt) be washed up with water.
When a thin layer of water has 2 layers of soap molecules, (one at each side), it is possible for all the hydrophile ends be in contact with water, and the hydrophobic end be as far as possible of it.
When we rub, or agitate a solution of soap, we facilitate that configuration by adding air into the solution.
The spherical form minimizes the surface energy. That is the same reason for the growth of the bubbles with time.
About the cleaning efficiency, what can be said is that bubbles are an indication of the presence of soap molecules. And soap cleans.
