Yes, but pasta is still mostly carbs. The carbs are very long chains (muuuuuuuuuuch longer than table sugar and non-linear); if you cooked them long enough (specially with the addition of a bit of acid) they’d dissolve, but it’s similar to the difference between trying to dissolve a spoonful of table salt or a chunk of table salt (in the case of pasta, the difference is bigger than in the case of salt). Proteins hydrolize and dissolve too.
I read a fascinating article in an ACS journal once, about “why pasta sticks”.
Picture that O is a ring of glucose (whole or missing a bit in order to link to another ring). Table sugar is OO. A molecule of water can break the bond between the two rings (hydrolisis), sticking an -OH to one ring and the +H to the other ring.
Food carbs (potatoes, pasta) are branched strings of OOOOOOOOOOOOOOOOOOOO… The most common bond between consecutive rings is the same as in table sugar; it can be hydrolized easily by regular water; more easily by acidic water; even more if certain enzymes that human bodies do have are present.
The bonds where a branch attaches to the “main one” are the same in chemical nature as the regular ones (polyeter, do not mistake with polyester) but they happen in a different position. A ring of glucose has 5 positions from which in theory it could bind to another. These bonds can still be broken by hydrolisis, acidic hydrolisis or by a different set of enzymes the human body has. Their regular hydrolisis is more difficult that for the straight lines, though, because they’re physically harder to reach (among other things, because as they happen at branch points, there’s three rings very close).
Fiber is mostly carbs, too, but carbs where the branching points are in a position for which the human body has no enzimes. Since we can’t absorb whole chunks of carbohydrate (they need to be broken down into small-enouogh chunks), we only can absorb the carb portions of “fiber” that have managed to break apart during the acidic digestion in the stomach. A straight line broken apart from the fiber is chemically and spatially identical to one broken from non-fiber carbs… it’s digestible.
OK, so you have your pasta. Cooked pasta. Part of the water in the pot (the part that got absorbed) has become part of the noodles themselves, by hydrolizing the carb (and aA) chains and incorporating itself into them.
If the pasta is left to rest warm, it sticks. How? By reverting the hydrolisis across noodles. A string of carbs from Noodle1 is in contact with a string of carbs from Noodle2, they get in the right position, have the necessary amount of energy (because the pasta is still warm), and they lose a molecule of water, creating a bond Noodle1-Noodle2. A single bond would be so weak that you wouldn’t even notice it, but if there is a large enough amount it becomes noticeable. This is also the reason why sometimes you think you’ve drained the noodles and after resting you can see more water: no, it’s not your imagination, there IS more water. The water that has (using the OP’s expression) squeezed itself back out of the noodles (some of it was also in the interstices between molecules, same as for the clothing).
The re-bonding happens also if you’re moving the noodles while they cool down, but it happens within each noodle, no noodle-crossing.