The line
<xsl:apply-templates select="@*"/>
applies template rules to all the attribute nodes. It's unusual to use apply-templates for attribute nodes, but it's perfectly legal, and it's useful when you want to apply generic processing. This will be matched by the second template rule with match="@*".
The other <xsl:apply-templates/> processes all child nodes (which doesn't include attributes). These will be matched by the first template rule (recursively) for elements, and by the built-in template rules for text, comment, and PI nodes. (Actually this stylesheet will delete comments and PIs, if you don't want that, add template rules to match them and copy them).
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference