A note, to ward off confusion: This was done with a real cartridge, but with a computer hooked up to the controller ports; it wasn't done unassisted.
So pong and snake where already in SMW?
No. They weren't. That's the idea. By exploiting some bugs, they managed to make the game execute arbitrary code. The menu, the two games and the victory screen were all programmed by manipulating the RAM using nothing but controller input.
This is why it's so bloody impressive.
This is impressive. Emulators have nuances that make me wonder when watching TASs if they would actually work on the game itself.