fact(5) = 5 x fact(4), and so on down to fact(0) = 1. Each call pushes a frame with its argument. A frame cannot finish until the call it made returns, so the frames pile up on the way down and unwind on the way back.
Computing factorial of 5 on an empty call stack.
fact(5) needs fact(4) before it can multiply, so it calls it. The new frame goes on top and fact(5) waits below it.
Call fact(5), depth 1.
fact(4) needs fact(3) before it can multiply, so it calls it. The new frame goes on top and fact(4) waits below it.
Call fact(4), depth 2.
fact(3) needs fact(2) before it can multiply, so it calls it. The new frame goes on top and fact(3) waits below it.
Call fact(3), depth 3.
fact(2) needs fact(1) before it can multiply, so it calls it. The new frame goes on top and fact(2) waits below it.
Call fact(2), depth 4.
fact(1) needs fact(0) before it can multiply, so it calls it. The new frame goes on top and fact(1) waits below it.
Call fact(1), depth 5.
fact(0) is the base case: it returns 1 without calling anything. The stack is at its deepest, 6 frames, one per call.
Base case fact(0) returns 1.
fact(0) returns 1.
fact(0) returns 1, depth 6.
fact(0)'s frame is popped and fact(1) resumes with the 1 it was waiting for: 1 x 1 = 1, which it returns in turn.
fact(1) returns 1, depth 5.
fact(1)'s frame is popped and fact(2) resumes with the 1 it was waiting for: 2 x 1 = 2, which it returns in turn.
fact(2) returns 2, depth 4.
fact(2)'s frame is popped and fact(3) resumes with the 2 it was waiting for: 3 x 2 = 6, which it returns in turn.
fact(3) returns 6, depth 3.
fact(3)'s frame is popped and fact(4) resumes with the 6 it was waiting for: 4 x 6 = 24, which it returns in turn.
fact(4) returns 24, depth 2.
fact(4)'s frame is popped and fact(5) resumes with the 24 it was waiting for: 5 x 24 = 120, which it returns in turn.
fact(5) returns 120, depth 1.
fact(5) = 120 and the last frame is popped. The stack reached 6 frames, so this recursion costs O(n) space on top of the O(n) multiplications. Each frame did its multiplication only after the call above it returned.
Result 120 with a maximum depth of 6.