The 3ds is backwards comparable with dsi, which is backwards compatable with ds, which is backwards compatable with gba.
Each of these consoles used the hardware from the previous generation to some extent.
To run gba games the 3ds boots into a modified twl firm to boot the gba hardware buried within. Some parts are emulated (or simulated) because they weren't needed for ds backwards compatability. The 3ds stores the gamepak rom in FCram for example.
Ninty actually tried a software emulator for gba games. You can inject a gba rom into certain virtual console releases and get a buggy, and VERY slow gba emulator running. They dropped it in favor of hardware to keep their promise to the Ambassators.