A conventional keyboard matrix can be drawn as rows and columns of wires, with a switch where each row wire crosses a column wire.
You scan the matrix by (for example) having pull-up resistors on each of the column wires. You drive one of the row wires low, and see which of the column wires have gone low in response - and you conclude that the switches on the junctions between the driven row and the responding column(s) are closed (i.e. pressed).

This is fine until you have several switches closed.
Suppose you have the switches that join row A with column 2, row A with column 3 and row B with column 3 all closed.
When you pull row B low, column 3 will be pulled down.
The problem is that this will pull row A low. And this will pull column 2 low so you think you have the switch between row B and column 2 closed as well.
(Sorry I'm no good at ascii art).

There is a fix:
Put a diode in series with each switch.

Hope this helps.
- Danish