Let me trace factorial() step by step. Each call waits for the next to return. factorial() calls factorial(), which calls factorial(), which calls factorial(), which calls factorial(). factorial() hits the base case and returns .
Now the chain unwinds: factorial() returns , factorial() returns , factorial() returns , factorial() returns . Notice how results multiply back up. The recursion "remembers" each waiting call. This is the call stack in action.