It redefines the \numberline macro that inserts and sets the algorithm number into the LoA. For a good discussion on the meanings and placement/usage of these macros, read the tocloft packagedocumentation (section 1.1 LaTeX's methods). Bracing (or grouping using \begingroup...\endgroup) localizes the scope so it does not affect \numberline used by other contents structures. Here's the full code that redefines \listofalgorithms so it can be cleanly used inside your document body: