It's called
recursion, and its a fundamental algorithm.
Think about factorials for a moment: N! = N * (N - 1)! for all values of N greater than zero - for all others N! is 1. So if N is 5, then N! can be expressed as
5! = 5 * (5 - 1)! == 5 * 4!
and the:
4! = 4 * (4 - 1)! == 4 * 3!
3! = 3 * (3 - 1)! == 3 * 2!
2! = 2 * (2 - 1)! == 2 * 1!
1! = 1
So this gives us:
5! = 5 * 4 * 3 *2 * 1
The factorial expression is naturally recursive because it's result is expressed in terms of itself.
That's what your code is doing: it check if the current node exists, and if not, it returns without doing anything.
Otherwise, it recursively calls itself on the next node, and when that returns it prints the current node.
So nothing gets printed until it gets to the final node, which is printed first. Then it returns, and prints the previous node, and so on back to the beginning.
Having said that, it's a piss poor piece of coding that barely works at all - because as the linked list grows, it consumes stack space and that is very small indeed - typically 1MB, and all return addresses, parameters, and local variables take up stack space. Grow the list too large, and you will run out of stack space, and your app will crash.
Recursion is a powerful tool - but it needs to be used with care, and only where it can be completely justified. Linked lists aren't recursive, so it's a very poor idea to process and iterative collection using recursive methods.