You can understand more clearly using two basic concepts.
First, Static variable assign memory only once in the entire execution of a program, unlike local variable can have a reference of more than one memory after each local declaration.
Second, Visually the recursion call stored activation record in a stack.
Thing going like that:
Let the declaration of a static variable is line number 1 and accordingly other follow line number.
In each call function run only up to line number 3 and store its state in stack activation record and static value reduce its value continuously (4,3,2,1) at i=0, the condition will fail. After line number 3, the execution of other state stored in stack execute started and get the value of i=0 at each time.
There is four activation record in the stack for i=4,3,2,1 so 4 zeros print consecutively.
If this program is tail recursive, it need not store the state in stack and value print (4,3,2,1) if you call main after printf
If you know stack and how the activation record stored in a stack then you can visualize my explanation easily.
If anyone feels anything wrong, pls comment.
Thanks!