Could someone please explain to me how this function works? I know what it does but when I look at the source code in the twenty\_ten template, I don't get how all loops are being collected in one single loop.php ( I saw that file too).

So how do for instance abstract away a certain common part of template and then reuse it across other templates?