They work much like real soap does.
So they make a lather, and split fats into smaller bits, and split red blood cells into smaller bits as well. Based on that last, there are spurious "don't eat this plant!" warnings out there - but hey, do you use soap on your open wounds? Soap splits your red blood cells as well, but you don't see warnings against eating that, do you?
Or yes, you do see warnings against eating real soap, but that's because of its (rather mild) puke'n'purge effect. Which you can also get from drinking too much saponin-rich plant tea. "Toxic", my tiny hiney.
But right there is a pet peeve: whatever makes you think that a topical action is anything even remotely like the action of the same compound when ingested? That's as bad as suggesting that the action of a single constituent in a glass vial equals the action of the plant in real live people ... bleh for muddy thinking, sez I.
The only really saponin-rich plant I use is horse chestnut, and there I prefer the leaf over the saponin-rich seeds: I make a horse chestnut salve, and the juicy bits go into my oils faster from leaves than from denser things like seeds, barks and roots. Horse chestnut helps strengthen capillaries, so I use it in salves for varicosities and hemorrhoids.
Another warning for saponin-rich plants is the "it stuns fish, it's toxic, toxic I tell you!" thing. Fish have gills, and saponins make their gills not work anymore. So if you have gills: stay far away from saponins. Stay off the soap, too, it'll be just as bad for you. If you don't have gills, well, puke'n'purge isn't all that toxic - there's much much worse.
I'll be testing soapnuts for their washing actions any month now, too. If that tests out OK I'll switch to soapwort root (Saponaria), cos that's in my garden: it contains less saponins than the soapnuts, but shrug - I'll just use more, eh?
Oh, and saponins are glycosides, too - one of the special groups of glycosides.
Other entries: Soapnuts - Constituents - Glycosides - Fishing and saponins