Pasta is loaded with starch, and when you boil starch it gelatinizes a bit and basically turns into glue.
A lot of that starch gets discarded with the pasta water, but the starch left over in the pasta will go sticky once it’s had a chance to cool a bit. It’s actually a good thing, that sticky exterior is what lets pasta hold onto all kinds of sauces.
Latest Answers