Buffer Overflow

Why does a stack buffer overflow potentially allow an attacker to execute arbitrary code?