I have no idea on your specific application, but judging from the number of pins it uses it sounds like the classic row and column method.
A logical one is shifted along the rows and between shifts the micro checks the corresponding column inputs for that row, if a switch is made it pulls the input to the micro down against its pullup resistor.
the micro then shifts the bit and checks the inputs on the nest column, this happens on all 4 columns and then the whole process is repeated at something like 50 times a second, fast enough not to miss a keypress but not so fast as to pick up any key bounce.
Instead of shifting the 1 along the rows, some do the reverse and shift the 1 along the columns.
The idea is to reduce the number of input pins.