Older games for specific older console hardware were specifically designed.
It leveraged specific features of that hardware.
They literally hacked the consoles they were releasing on to get their desired results.
And because it's consumer gaming hardware/software neither backwards compatible nor forward compatibility for all the stuff the pulled were ever built in. So a game would have to target multiple platforms to actually release on multiple platforms .
It's like why so many games don't run Mac OSX. "Why don't they just release windows software for free on Mac OSX?". Because it needs to be redesigned to work on OSX, which costs money.
Everything up to, what, PS4? is probably specifically tailored to that specific hardware. Games that released on PS3 and xbox-whatever would have some core software dev team, then hardware specific developers. It would be targeted for the target hardware.
At some point, things like Unity and Unreal Engine took over, with generic code and targeted compiling. Pretty much (not quite) allowing developers to "just hit compile", and release to multiple architectures.
Any official re-release of Nintendo games have generally been on an emulated system. Where they have developed that emulation to work with the original software.
There are some re-releases, where the game has essentially been rebuilt from the ground up, using original assets but to work with modern (and flexible) game engines.
Both of these have a lot of work, so not free. Worth $60 or whatever Nintendo charges? Meh, that's competing with real games.
If you own (or buy) a nes/snes/N64 cart, you can rip it. There are plenty of ways.
It's not the source, but it's what it compiles to. And you can reverse engineer the source, then adapt it to modern game engines. There are a few open source projects that do this. Their quality varies.
Or you can build an emulator to run that software, as if it was the original hardware - an emulator.
Nintendo can skip the rip, decompile and reverse engineering steps. They likely have access to the source code, and the actual design specs for the hardware (not just what they tell developers - who then hack the hardware anyway)
All of this requires a LOT of work. So a sellable product from someone like Nintendo requires a lot of investment.
Emulators are good. Any used for speedrun leaderboards on equal footing to actual hardware (ie times are similar, even if they are different categories) will be good enough that you wouldn't know.