Most C implementations won't bother to protect the stack or heap from being overwritten by a few bytes only. (There's a library aptly named Electric Fence that can do so). Chances are, if you write enough data, you'll eventually write beyond the allowed address space and the program crashes in one way or another (this depends on many factors, like OS, compiler, options). As you noticed by now, this answer is very vague. The reason is that what you do is technically called undefined behavior by the C Standard, which means the implementation is free to do anything, including nothing.
Why is it so? Why doesn't the C Standard have a clause saying
3.1.4.1.5 When an access outside of allocated memory is attempted, a statement equivalent to fprintf(stderr, "illegal access at %p\n", (void *)address);
shall be executed.
The reason is that this would place a heavy burden on the implementation. The compiler probably would have to generate code to check for illegal accesses after almost all pointer modifications and function calls. C is, by design, a tiny language where programmers get mostly what they ask for and no "invisible code" in addition.
And then, stderr
may be closed or non-existent :-)