Like Sega where the Mega Drive can play Master System games via an adapter, the SNES was going to have backwards compatibility with the NES (it had an evolved version of the processor). Yet Nintendo decided to pull out due to costs. There were a few SNES games though that were NES ports (e.g. Wrecking Crew) and wouldn't be surprised if Super Mario All-Stars and BSX Zelda used or referenced the NES source code.
Which is why this exists really.