Agriculture grade SAP consists of a set of polymeric chains that are parallel to each other and regularly linked to each other by cross-linking agents, thus forming a network.
When water comes into contact with one of these chains, it is drawn into the molecule by osmosis. Water rapidly migrates into the interior of the polymer network where it is stored. That's how SAP powder turns to water gel.
As this water gel's absorption ability is bigger than soil but less than roots of plants, the absorbed water by SAP will be released to plants when it is dry.