When this happens, you can override the stack. As variables are pushed on the stack, you can influence the execution of the program, for example return address. This can be exploited using ROP (Return Oriented Programming) and then you've got full control.