Mental Model
A function calls itself with a smaller number until it reaches 1, then multiplies all those numbers back up.
Analogy: Imagine stacking blocks: you keep adding one block on top of the smaller stack until you reach the base block, then count all blocks by multiplying their heights.
factorial(3)
↓ calls factorial(2)
↓ calls factorial(1)
↓ returns 1
← returns 2 * 1 = 2
← returns 3 * 2 = 6