Learn a little more
Review scriptmodules/system.sh and the module files at a recorded source revision. Detection, dependency installation, source retrieval, compilation, installation and configuration are distinct steps. Keep their logs and failure states separate.
Where does it fit in a gaming setup?
01Your board
The physical processor, memory, graphics hardware and connectors.
02Linux & device drivers
The operating system talks to the specific board. A driver for one chip is not a universal driver.
03Graphics & audio libraries
Mesa, SDL and audio services connect applications to the operating system. The exact path depends on the application.
04EmulationStation
The menu used to choose a system and launch a game. It does not emulate every console itself.
05RetroArch or a standalone emulator
The program that runs the game. RetroArch hosts emulator cores; standalone emulators run independently.
06Emulator core & game content
A core implements a system inside RetroArch. Game and optional firmware files have separate compatibility and rights requirements.
RetroPie-Setup installs and configures parts of this stack. This is a conceptual map, not a claim that every emulator uses every layer in this order.
Try the next useful step
You can follow the installation guide without mastering every layer. If something fails, use troubleshooting to isolate the symptom.
Source: Primary project documentation ↗. Original explanation by this companion site.