For kids who got soap enemas that burned, why didn't your parents just use glycerin or warm water?
My thinking on this is that a household is much more likely to have soap around than glycerin. It is known that adding soap or glycerin or other (specific!) chemicals makes the enema more effective, and I imagine most parents aren't eager to repeat enemas more than necessary, so in their thinking one "good and soapy" one is better than a couple water ones. Further speculation - most instructions for soapsuds enemas are very vague about how much soap to use, or sometimes even suggest a significant amount. Many parents probably wind up making the enema soapier than it needs to be.
Essentially soap is a base, a very corrosive type of substance, often even more corrosive than many acids.
I believe that sodium hydroxide is the basic substance in soap, but very very very strongly diluted.
Fat is an ester (compound) of a fatty acid and glycerin. Making soap uses sodium or potassium hydroxide to split the glycerin off the ester. The hydroxide forms a salt with the fatty acid, and if done properly there will be very little free base left. In most cases soap appears to not cause a problem - in studies biopsies can see a difference in surface epithelium for a day or so, but then it seems to grow back. Very strong soap solutions (don't know exactly what this means, so I play it safe) or stupid soap solutions (antibacterial, detergent, and the like) can cause chemical colitis, not fun and potentially life-threatening.
I did see a nursing text from the '20s with the following slightly scary note: "Laundry soap is more effective in moving the bowels than white soap, but is more irritating." Given that laundry soap tends to have more free alkali than other soaps I wouldn't use it, even if it is "more effective" (especially given their recommendation to "[make] it fairly strong".