I also don’t know exactly how it works. I’ve just found out about Zaparoo and it sounds interesting, but I have never used it.
There was (at least) one PR adding some Zaparoo features to EmulationStation. In this case, it only adds the “Write game on NFC tag” menu entry. A similar menu entry could be added to RetroArch (probably in the Quick Commands menu after a content is loaded). I’m assuming some extra Zaparoo settings screens could be needed/useful (just like Bluetooth settings).
Additionally, there is platform-specific code for each of the several platforms. Apparently, it has built-in code for many launchers, such as steam, kodi, EmulationStation (and Desktop Edition) and flatpak, heroic, lutris. In some cases in Batocera, it seems Zaparoo emulates keystrokes using Batocera’s hotkeygen tool.
This means it should be possible to write code in Zaparoo Core to interact with RetroArch/Lakka, using whatever API is available. This also means that adding RetroArch support to Zaparoo will benefit all platforms where RetroArch can run (in addition to Lakka).
Since zaparoo-core is written in Go, and (usually) Go binaries are statically linked, adding it to Lakka won’t pull in many dependencies (or potentially no dependencies at all).
Although using a hardware NFC reader is the main use-case, it also supports barcodes (either through a hardware barcode scanner or through the Zaparoo mobile app), MQTT (which can even be integrated with Home Assistant) and others. This means it is possible to get started without having to buy any additional hardware (although not having the hardware tokens kinda defeats the purpose).
And that’s all I’ve learned so far. 