Concept Flow - Stack overflow concept
Function call starts
Push call frame on stack
Execute function body
Function calls itself (recursion)
Push new call frame on stack
Repeat until stack limit reached
Stack overflow error thrown
Program crashes or stops
When a function keeps calling itself without stopping, each call adds a new frame to the stack. If this goes on too long, the stack runs out of space and causes a stack overflow error.