A standard keyboard saves cost by not having individual wires connected to every key but instead conveying a key press as a combination of several signals. T
Imagine a grid of wires 5 to a side. Now with sampling only ten wires you can detect which of 25 possible intersections are being triggered.
The particular way in which those simple keyboards are set up is such that pressing three or more keys cannot be distinguished into the specific keys being pressed; there is ambiguity in what is happening and the computer sounds the beep to warn the user that their input isn't acceptable.