Recursion and the call stack

A recursive function calls itself on a smaller case until it reaches a base case, and each call gets its own frame on the call stack with its own variables, so the answers are built as the calls return, and a missing base case fills the stack.

From Data Structures and Algorithms.