After cooking when you drain the pasta and rinse with cold water, the cooking stops. This helps the pasta to retain its al-dente texture and also removes extra starch. Moreover, it cools down which makes the salad tastier.