Summary: Sega QA tested games and rejected any game that crashed, so the developer 'try/catch'ed* all errors into the level select.<p>Punching or wiggling the cartridge triggers one such error state.<p>* Pointed all error interrupts to the level select.
You can get to the level select screen in Sonic 3 using a similar process.<p>1. Open Sonic 2 and enter the level select cheat<p>2. Freeze the game by wiggling the cartridge<p>3. Replace the cartridge with Sonic 3, and hit the reset button<p>This blew my mind as a kid.