The Genesis, like most post-NES systems, uses fewer wires than buttons, and an encoder is used to 'compress' the eight buttons into six wires. The mechanism is simple: a 74157 chip takes two pairs of four inputs, delivering one set of four to the console based on the status of the SELECT line. Paraphrased, the console asks for the first set by keeping select HIGH, and the second set by holding select LOW.
The schematic is very simple:
Data for this originally taken from Neal Patrick Howland.