So, several things.
1. Cubic ninja was not actually the first way to get homebrew. Before that, we had the MSET exploit on 4.x, and I know that Smea used that to have a CFW before it was cool. I can remember him showing off Yeti3D "working as its own channel" as Smea himself said. His CFW also made possible RAM dumps and injection as his Pokéhax proved (he had Mew, Hoopa, Volcanion and Diancie as wild encounters).
2. He then showed off a never released hax that used the same MSET entry point which he called sssPwn. It is believed that it was used, as a part or entirely, in what will later become Ninjhax.
3. Several months later, he announced he had a hack which could allow people to access homebrew in an easy way. We didn't know it at that time but that was Ninjhax 1.0. What's actually possible is that he used the RAM dump/injection capabilities of his CFW to find the flaw. But in the end, the only thing we need is the QR code and an Internet connexion as the QR code is not large enough to fit the entire payload.