I want to know why exactly static variables in C, C++ and Java are initialized by zero by default? And why this is not true for local variables?
So to some extent these are just design decisions on the part of the language designers. But the probable reasons for these decisions in Java are:
In the case of local variables, it's also conceivable that a local variable could be declared (which at the bytecode/machine code level essentially means allocating stack space/moving the stack pointer) but then never actually written/read in a particular code path. So not having a default avoids doing unnecessary work of setting a default in those cases.
I repeat, though, these are design decisions to some extent. They're essentially a tradeoff between what's likely to be convenient for JVM implementations and convenient for programmers.
N.B. In C/C++, "static" variables mean a different thing to static variables in Java!