Knowing the number of categories present in the result may be useful for html design!
end function must by like this:
if ( $echo ) echo $output; return count($categories); else return $output;
Of course, the general idea is that some functions to return aditional results in a global variable or by a specialized function.
Best example is "mysql_error" php function, that "Returns the text of the error message from previous MySQL operation".
So, wp_last_result() can return extended result from previous function. Certainly it is not necessary for all functions !