I'm not sure how much Chemistry you've had, so I'll keep this kind of simple.
Wood fibers are tube-shaped cells made primarily from cellulose, hemicellulose, and lignin.
If you remove the lignin from wood fibers, you get paper fibers, also called pulp. Toilet paper is made from pulp. So pulp is basically tube-shaped fibers made from cellulose and hemicellulose.
Cellulose and hemicellulose are very hydrophilic, which means they have a strong affinity for water. This is because they have a lot of -OH groups. Water is attracted to -OH groups by hydrogen bonds. Hydrogen bonds aren't very strong, but the surface of each fiber has many, many -OH groups, so the water is held tightly to the paper fiber.
That's how absorption works when water is exposed to toilet paper.
(My first "real" job was in the Fiber Science lab at a large paper company.)