Of course they're emulated, you can't fit the original hardware inside the 3DS. The emulators come with each title you purchase instead of having a single emulator for let's say all GB games, partially because they feature custom settings and optimizations for each title.
The emulators they use are their own custom coded property, as well as the ROMs they've dumped.
Do the games have the same code as they would on the ROM like on the 3DS?
The question is hard to understand, sorry, but I'll try to answer it anyway. Everything uses ROMs, cartridges whether it's DS, 3DS or NES ones have a ROM stored inside. The only difference here is that they made official backups of those files so that they can digitally sell them on the eShop.