Can you explain how miralax (polyethylene glycol) works?

Osmotic laxative. If you remember from science class putting sugar or other dry compound in small amount of water and placing it in lager container of tap water the tap water would cross the plastic bag and dilute the sugar water......Miralax (polyethylene glycol) is an osmotic laxative it prevents water from being absorbed in the gastrointestinal tract thereby getting more water to the anus vice a dry poop.