“Why is this allowed to happen?” (write outside of bounds)
C does not require the additional CPU instructions that would typically be needed to prevent this out-of-range access.
That is the speed of C – it trusts the programmer, giving the coder all the rope needed to perform the task – including enough rope to hang oneself.