I understand how soaps lower the surface tension of water but I don't know what the purpose of this is. How does this help with cleaning, removing stains etc?
The lowering of surface tension is a side effect, though it does relate to the reason why we use soaps when cleaning things.
Many of the things we want to clean are not naturally soluble in water (e.g. things like vegetable oil). The structure of soaps and detergents usually consist of molecules with two parts: one is water-loving and one is oil-loving. When soaps are added to mixtures of oily things and water, they align so the oil-loving parts of the molecules surround the oil and present only a water loving surface to the bulk water. Thus the oil is made much more soluble than it would be otherwise (so it is possible to remove it from your clothes, hands or dishes despite most of the liquid being water).
In reality the situation is quite complicated but the general principles of how soaps and detergents work is captured by this basic view.
The effect on surface tension is related to this. The soap molecules tend to cluster at the surface of the water (to get their oil-loving ends away from the water environment). This breaks up the surface structure of water molecules that normally create strong surface tension. But this effect is basically the same effect that enables soaps to solubilise normally insoluble things in bulk water.