If you are interested in non-GUI aspects you might take a look at the Arduino CLI source code. I know I find that code much more approachable than either of the IDE's code:
An increasing amount of the functionality of the classic IDE is handled by Arduino CLI, and the IDE 2.x was built on top of Arduino CLI from the very start, using it for everything that is not GUI-specific.