main() calling f1(), f1() calling f2(), f2 calling f3()…
A function calls another function and chain goes on.
When a function is called, A structure named Activation-record or stack-frame is prepared that contains the information associated with it’s call. This information is : local variables, parameters passed in, pointer to the caller function and returning variable(if non-void). That activation-record(structure pointer) of each function is pushed on to a stack called program-stack or run-time-stack.
This is how the architecture of nested function calls is created.
KeyNotes : A limited amount of memory is allocated to stacks(depends on OS) once number of functions exceed(like in case of recursive functions), It hits the memory limit and stack-overflow occurs. You can’t trace the your program’s program-stack at run time.