Mayo Clinic describes rectal prolapse as a medical condition where:
Rectal prolapse occurs when part of the large intestine's lowest section (rectum) slips outside the muscular opening at the end of the digestive tract (anus). While rectal prolapse may cause discomfort, it's rarely a medical emergency.
And that's how this post gets to why medical practitioners use sugar to help correct a prolapsed rectum. Starting with the nomenclature, where some refer to this procedure as the Slug Method, a Sour Patch Kid or Sugaring The Rim, which originates from the use of table sugar to pull water through the skin using osmosis, and relieve pressure so parts can go back to where they belong on the inside. Enough preamble from the layman, here's nurse.chen going deeper than you might have wanted to go: